# HG changeset patch # User Sylvain Thénault # Date 1304938069 -7200 # Node ID 591d6ed3e1f4cdaefba9149c60cab91f16c91e1c # Parent 0c8c386d653bf3e2732d4a68e18e82999ded66c5# Parent 67cd9d5b4c2ed1e0908ebdb39455b2e5a6effa4e backport stable diff -r 0c8c386d653b -r 591d6ed3e1f4 devtools/testlib.py --- 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: diff -r 0c8c386d653b -r 591d6ed3e1f4 i18n/en.po --- 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 "" diff -r 0c8c386d653b -r 591d6ed3e1f4 web/views/cwuser.py --- 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'%s' % ( self._cw.build_url('add/%s' % eschema), - self._cw._('add a %s' % etype).capitalize())) + self._cw.__('New %s' % etype).capitalize())) self.w(u'
') self.wview('cw.user-table', self._cw.execute(self.rql))