Reverse order of sanity checks: check email_verified after making sure there's a...
authorAaron Williamson <aaron@copiesofcopies.org>
Tue, 4 Oct 2011 00:28:48 +0000 (20:28 -0400)
committerAaron Williamson <aaron@copiesofcopies.org>
Tue, 4 Oct 2011 00:28:48 +0000 (20:28 -0400)
mediagoblin/auth/views.py

index dc4c540b4710897870efe1bb0b382ec0e3860140..d8c441ef7973f0b236a5666e3664c39a35750e61 100644 (file)
@@ -196,21 +196,21 @@ def resend_activation(request):
     Resend the activation email.
     """
 
-    if request.user["email_verified"]:
+    if request.user is None:
         messages.add_message(
             request,
             messages.ERROR,
-            _("You've already verified your email address!"))
+            _('You must be logged in so we know who to send the email to!'))
         
-        return redirect(request, "mediagoblin.user_pages.user_home", user=request.user['username'])
+        return redirect(request, "/auth/login")
 
-    if request.user is None:
+    if request.user["email_verified"]:
         messages.add_message(
             request,
             messages.ERROR,
-            _('You must be logged in so we know who to send the email to!'))
+            _("You've already verified your email address!"))
         
-        return redirect(request, "/auth/login")
+        return redirect(request, "mediagoblin.user_pages.user_home", user=request.user['username'])
 
     request.user[u'verification_key'] = unicode(uuid.uuid4())
     request.user.save()