comparison MoinMoin/apps/admin/views.py @ 2664:772810aa8013

Solved traceback as per issue #417 Once a user registers he is sent a mail to his given email for confirmation of his account creation details. Till the time they confirm their account details, the email provided by them is stored with the 'EMAIL_UNVALIDATED' key. Only after the user confirms the account the email is stored with 'EMAIL' key. So this caused the error as in case of an unconfirmed user there was no 'EMAIL' key, so to solve that check for 'EMAIL' and 'EMAIL_UNVALIDATED' key has been added.
author Ajitesh Gupta <ajgupta93@gmail.com>
date Sat, 05 Jul 2014 17:11:57 +0530
parents ee404f81afe9
children c04690fb2305
comparison
equal deleted inserted replaced
2655:bc0f43fecbc7 2664:772810aa8013
18 from whoosh.query import Term, And 18 from whoosh.query import Term, And
19 from MoinMoin.i18n import _, L_, N_ 19 from MoinMoin.i18n import _, L_, N_
20 from MoinMoin.themes import render_template, get_editor_info 20 from MoinMoin.themes import render_template, get_editor_info
21 from MoinMoin.apps.admin import admin 21 from MoinMoin.apps.admin import admin
22 from MoinMoin import user 22 from MoinMoin import user
23 from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED, NAME_EXACT, WIKINAME, TRASH, NAMESPACE, NAME_OLD, REVID, MTIME, COMMENT 23 from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED, NAME_EXACT, WIKINAME, TRASH, NAMESPACE, NAME_OLD, REVID, MTIME, COMMENT, EMAIL_UNVALIDATED
24 from MoinMoin.constants.namespaces import NAMESPACE_USERPROFILES, NAMESPACE_DEFAULT, NAMESPACE_ALL 24 from MoinMoin.constants.namespaces import NAMESPACE_USERPROFILES, NAMESPACE_DEFAULT, NAMESPACE_ALL
25 from MoinMoin.constants.rights import SUPERUSER 25 from MoinMoin.constants.rights import SUPERUSER
26 from MoinMoin.security import require_permission 26 from MoinMoin.security import require_permission
27 from MoinMoin.util.interwiki import CompositeName 27 from MoinMoin.util.interwiki import CompositeName
28 28
47 groups = flaskg.groups 47 groups = flaskg.groups
48 revs = user.search_users() # all users 48 revs = user.search_users() # all users
49 user_accounts = [dict(uid=rev.meta[ITEMID], 49 user_accounts = [dict(uid=rev.meta[ITEMID],
50 name=rev.meta[NAME], 50 name=rev.meta[NAME],
51 fqname=CompositeName(NAMESPACE_USERPROFILES, NAME_EXACT, rev.name), 51 fqname=CompositeName(NAMESPACE_USERPROFILES, NAME_EXACT, rev.name),
52 email=rev.meta[EMAIL], 52 email=rev.meta[EMAIL] if EMAIL in rev.meta else rev.meta[EMAIL_UNVALIDATED],
53 disabled=rev.meta[DISABLED], 53 disabled=rev.meta[DISABLED],
54 groups=[groupname for groupname in groups if rev.meta[NAME] in groups[groupname]], 54 groups=[groupname for groupname in groups if rev.meta[NAME] in groups[groupname]],
55 ) for rev in revs] 55 ) for rev in revs]
56 return render_template('admin/userbrowser.html', user_accounts=user_accounts, title_name=_(u"Users")) 56 return render_template('admin/userbrowser.html', user_accounts=user_accounts, title_name=_(u"Users"))
57 57