changeset 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 bc0f43fecbc7
children 73adb7dfd1bd
files MoinMoin/apps/admin/views.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/views.py	Thu Jul 03 22:04:50 2014 +0200
+++ b/MoinMoin/apps/admin/views.py	Sat Jul 05 17:11:57 2014 +0530
@@ -20,7 +20,7 @@
 from MoinMoin.themes import render_template, get_editor_info
 from MoinMoin.apps.admin import admin
 from MoinMoin import user
-from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED, NAME_EXACT, WIKINAME, TRASH, NAMESPACE, NAME_OLD, REVID, MTIME, COMMENT
+from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED, NAME_EXACT, WIKINAME, TRASH, NAMESPACE, NAME_OLD, REVID, MTIME, COMMENT, EMAIL_UNVALIDATED
 from MoinMoin.constants.namespaces import NAMESPACE_USERPROFILES, NAMESPACE_DEFAULT, NAMESPACE_ALL
 from MoinMoin.constants.rights import SUPERUSER
 from MoinMoin.security import require_permission
@@ -49,7 +49,7 @@
     user_accounts = [dict(uid=rev.meta[ITEMID],
                           name=rev.meta[NAME],
                           fqname=CompositeName(NAMESPACE_USERPROFILES, NAME_EXACT, rev.name),
-                          email=rev.meta[EMAIL],
+                          email=rev.meta[EMAIL] if EMAIL in rev.meta else rev.meta[EMAIL_UNVALIDATED],
                           disabled=rev.meta[DISABLED],
                           groups=[groupname for groupname in groups if rev.meta[NAME] in groups[groupname]],
                      ) for rev in revs]