misc/migration/postcreate.py
branchstable
changeset 4612 d6ae30c5d055
parent 4212 ab6573088b4a
child 4835 13b0b96d7982
--- a/misc/migration/postcreate.py	Wed Feb 17 13:16:50 2010 +0100
+++ b/misc/migration/postcreate.py	Wed Feb 17 13:23:36 2010 +0100
@@ -5,7 +5,6 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
 """
-
 # insert versions
 create_entity('CWProperty', pkey=u'system.version.cubicweb',
               value=unicode(config.cubicweb_version()))
@@ -38,9 +37,8 @@
         print 'you are using a manager account as anonymous user.'
         print 'Hopefully this is not a production instance...'
     elif anonlogin:
-        rql('INSERT CWUser X: X login %(login)s, X upassword %(pwd)s,'
-            'X in_group G WHERE G name "guests"',
-            {'login': unicode(anonlogin), 'pwd': anonpwd})
+        from cubicweb.server import create_user
+        create_user(session, unicode(anonlogin), anonpwd, 'guests')
 
 # need this since we already have at least one user in the database (the default admin)
 for user in rql('Any X WHERE X is CWUser').entities():