aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mediagoblin/auth/views.py19
-rw-r--r--mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po12
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."