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 | |
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
-rw-r--r-- | mediagoblin/auth/views.py | 19 | ||||
-rw-r--r-- | mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po | 12 |
2 files changed, 28 insertions, 3 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) diff --git a/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po b/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po index 5e1401f6..f3e0c100 100644 --- a/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po +++ b/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po @@ -63,11 +63,19 @@ msgstr "" msgid "The verification key or user id is incorrect" msgstr "" -#: mediagoblin/auth/views.py:207 +#: mediagoblin/auth/views.py:203 +msgid "You must be logged in so we know who to send the email to!" +msgstr "" + +#: mediagoblin/auth/views.py:211 +msgid "You've already verified your email address!" +msgstr "" + +#: mediagoblin/auth/views.py:224 msgid "Resent your verification email." msgstr "" -#: mediagoblin/auth/views.py:248 +#: mediagoblin/auth/views.py:265 msgid "" "Could not send password recovery email as your username is inactive or " "your account's email address has not been verified." |