diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-20 20:00:08 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-20 20:00:08 +0100 |
commit | e51af0e62000b190d6aa828719080a96886210fb (patch) | |
tree | 71e83833165abd460c1af9009022e4feb0d29ff4 /mediagoblin/auth/views.py | |
parent | 0b3cdd6a25f8aaa74beecb7fed32a20cc13587a8 (diff) | |
parent | 2a8c1b058b43cfcdeb06f711bbf44af9432af410 (diff) | |
download | mediagoblin-e51af0e62000b190d6aa828719080a96886210fb.tar.lz mediagoblin-e51af0e62000b190d6aa828719080a96886210fb.tar.xz mediagoblin-e51af0e62000b190d6aa828719080a96886210fb.zip |
Merge remote branch 'remotes/aaronw/bug614_verification_crash'
* remotes/aaronw/bug614_verification_crash:
Update english translation file.
Reverse order of sanity checks: check email_verified after making sure there's a user in the request.
Make sure user isn't already verified before resending verification.
Check request.user to determine if user is logged in.
Regenerated English .po file to include new string.
Display and error and redirect to login page if unauthenticated user tries to access resend_verification.
Conflicts:
mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po
Diffstat (limited to 'mediagoblin/auth/views.py')
-rw-r--r-- | mediagoblin/auth/views.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 54cb1ab5..b3a70d46 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -195,9 +195,26 @@ def resend_activation(request): Resend the activation email. """ + + if request.user is None: + messages.add_message( + request, + messages.ERROR, + _('You must be logged in so we know who to send the email to!')) + + return redirect(request, "/auth/login") + + if request.user["email_verified"]: + messages.add_message( + request, + messages.ERROR, + _("You've already verified your email address!")) + + return redirect(request, "mediagoblin.user_pages.user_home", user=request.user['username']) + request.user[u'verification_key'] = unicode(uuid.uuid4()) request.user.save() - + email_debug_message(request) send_verification_email(request.user, request) |