backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 09 May 2011 12:47:49 +0200
changeset 7338 591d6ed3e1f4
parent 7336 0c8c386d653b (current diff)
parent 7337 67cd9d5b4c2e (diff)
child 7344 5290b5c586ec
backport stable
devtools/testlib.py
i18n/en.po
--- a/devtools/testlib.py	Mon May 09 12:02:26 2011 +0200
+++ b/devtools/testlib.py	Mon May 09 12:47:49 2011 +0200
@@ -356,7 +356,7 @@
 
     @iclassmethod # XXX turn into a class method
     def create_user(self, req, login=None, groups=('users',), password=None,
-                    commit=True, **kwargs):
+                    email=None, commit=True, **kwargs):
         """create and return a new user entity"""
         if isinstance(req, basestring):
             warn('[3.12] create_user arguments are now (req, login[, groups, password, commit, **kwargs])',
@@ -376,6 +376,9 @@
         req.execute('SET X in_group G WHERE X eid %%(x)s, G name IN(%s)'
                     % ','.join(repr(str(g)) for g in groups),
                     {'x': user.eid})
+        if email is not None:
+            req.create_entity('EmailAddress', address=unicode(email),
+                              reverse_primary_email=user)
         user.cw_clear_relation_cache('in_group', 'subject')
         if commit:
             try:
--- a/i18n/en.po	Mon May 09 12:02:26 2011 +0200
+++ b/i18n/en.po	Mon May 09 12:47:49 2011 +0200
@@ -3329,7 +3329,7 @@
 msgstr ""
 
 msgid "read_permission"
-msgstr "can be read by"
+msgstr "read permission"
 
 msgctxt "CWAttribute"
 msgid "read_permission"
@@ -3348,11 +3348,11 @@
 
 msgctxt "CWGroup"
 msgid "read_permission_object"
-msgstr "can be read by"
+msgstr "has permission to read"
 
 msgctxt "RQLExpression"
 msgid "read_permission_object"
-msgstr "can be read by"
+msgstr "has permission to read"
 
 msgid "regexp matching host(s) to which this config applies"
 msgstr ""
--- a/web/views/cwuser.py	Mon May 09 12:02:26 2011 +0200
+++ b/web/views/cwuser.py	Mon May 09 12:47:49 2011 +0200
@@ -33,16 +33,8 @@
 
 _pvs = uicfg.primaryview_section
 _pvs.tag_attribute(('CWUser', 'login'), 'hidden')
-_pvs.tag_attribute(('CWGroup', 'name'), 'hidden')
-_pvs.tag_subject_of(('CWGroup', 'read_permission', '*'), 'relations')
-_pvs.tag_subject_of(('CWGroup', 'add_permission', '*'), 'relations')
-_pvs.tag_subject_of(('CWGroup', 'delete_permission', '*'), 'relations')
-_pvs.tag_subject_of(('CWGroup', 'update_permission', '*'), 'relations')
-_pvs.tag_object_of(('*', 'in_group', 'CWGroup'), 'relations')
-_pvs.tag_object_of(('*', 'require_group', 'CWGroup'), 'relations')
 
 _affk = uicfg.autoform_field_kwargs
-
 _affk.tag_subject_of(('CWUser', 'in_group', 'CWGroup'),
                     {'widget': formwidgets.InOutWidget})
 
@@ -100,6 +92,11 @@
 
 # group views ##################################################################
 
+_pvs.tag_attribute(('CWGroup', 'name'), 'hidden')
+_pvs.tag_subject_of(('CWGroup', 'read_permission', '*'), 'relations')
+_pvs.tag_subject_of(('CWGroup', 'add_permission', '*'), 'relations')
+_pvs.tag_subject_of(('CWGroup', 'delete_permission', '*'), 'relations')
+_pvs.tag_subject_of(('CWGroup', 'update_permission', '*'), 'relations')
 _pvs.tag_object_of(('CWUser', 'in_group', 'CWGroup'), 'hidden')
 _pvs.tag_object_of(('*', 'require_group', 'CWGroup'), 'hidden')
 
@@ -185,7 +182,7 @@
             if eschema.has_perm(self._cw, 'add'):
                 self.w(u'<a href="%s" class="addButton right">%s</a>' % (
                     self._cw.build_url('add/%s' % eschema),
-                    self._cw._('add a %s' % etype).capitalize()))
+                    self._cw.__('New %s' % etype).capitalize()))
         self.w(u'<div class="clear"></div>')
         self.wview('cw.user-table', self._cw.execute(self.rql))