misc/migration/3.15.4_Any.py
author Julien Cristau <julien.cristau@logilab.fr>
Fri, 14 Feb 2014 14:46:25 +0100
changeset 9529 39b46b0b01e4
parent 8522 85b1c4b36d1d
child 10589 7c23b7de2b8d
permissions -rw-r--r--
[web/data] fix treeview regression (closes #3526466) Changeset 68cde7431c2c "[js] remove 3.9 bw compat (where apparently unused)" removed the use of form.callback from loadxhtml, which treeview relied on. Update to add a callback on the loadxhtml return value instead.

from logilab.common.shellutils import generate_password
from cubicweb.server.utils import crypt_password

for user in rql('CWUser U WHERE U cw_source S, S name "system", U upassword P, U login L').entities():
    salt = user.upassword.getvalue()
    if crypt_password('', salt) == salt:
        passwd = generate_password()
        print 'setting random password for user %s' % user.login
        user.set_attributes(upassword=passwd)

commit()