From: Aaron Williamson Date: Tue, 4 Oct 2011 00:28:48 +0000 (-0400) Subject: Reverse order of sanity checks: check email_verified after making sure there's a... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2fe6991660cd1a20f9117b0cdc88431085eb7490;p=mediagoblin.git Reverse order of sanity checks: check email_verified after making sure there's a user in the request. --- diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index dc4c540b..d8c441ef 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -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()