misc/migration/postcreate.py
branchtls-sprint
changeset 1398 5fe84a5f7035
parent 0 b97547f5f1fa
child 1977 606923dff11b
--- a/misc/migration/postcreate.py	Fri Apr 17 13:21:05 2009 +0200
+++ b/misc/migration/postcreate.py	Fri Apr 17 16:55:37 2009 +0200
@@ -1,22 +1,22 @@
 """cubicweb post creation script, set user's workflow"""
 
-activatedeid = add_state(_('activated'), 'EUser', initial=True)
-deactivatedeid = add_state(_('deactivated'), 'EUser')
-add_transition(_('deactivate'), 'EUser',
+activatedeid = add_state(_('activated'), 'CWUser', initial=True)
+deactivatedeid = add_state(_('deactivated'), 'CWUser')
+add_transition(_('deactivate'), 'CWUser',
                (activatedeid,), deactivatedeid,
                requiredgroups=('managers',))
-add_transition(_('activate'), 'EUser',
+add_transition(_('activate'), 'CWUser',
                (deactivatedeid,), activatedeid,
                requiredgroups=('managers',))
 
 # need this since we already have at least one user in the database (the default admin)
-rql('SET X in_state S WHERE X is EUser, S eid %s' % activatedeid)
+rql('SET X in_state S WHERE X is CWUser, S eid %s' % activatedeid)
 
 # create anonymous user if all-in-one config and anonymous user has been specified
 if hasattr(config, 'anonymous_user'):
     anonlogin, anonpwd = config.anonymous_user()
     if anonlogin:
-        rql('INSERT EUser X: X login %(login)s, X upassword %(pwd)s,'
+        rql('INSERT CWUser X: X login %(login)s, X upassword %(pwd)s,'
             'X in_state S, X in_group G WHERE G name "guests", S name "activated"',
             {'login': unicode(anonlogin), 'pwd': anonpwd})
 
@@ -30,11 +30,11 @@
         default = cfg.option_default(optname, optdict)
         # only record values differing from default
         if value != default:
-            rql('INSERT EProperty X: X pkey %(k)s, X value %(v)s', {'k': key, 'v': value})
+            rql('INSERT CWProperty X: X pkey %(k)s, X value %(v)s', {'k': key, 'v': value})
 
 # add PERM_USE_TEMPLATE_FORMAT permission
 from cubicweb.schema import PERM_USE_TEMPLATE_FORMAT
-eid = add_entity('EPermission', name=PERM_USE_TEMPLATE_FORMAT,
+eid = add_entity('CWPermission', name=PERM_USE_TEMPLATE_FORMAT,
                  label=_('use template languages'))
 rql('SET X require_group G WHERE G name "managers", X eid %(x)s',
     {'x': eid}, 'x')