From 2fe6991660cd1a20f9117b0cdc88431085eb7490 Mon Sep 17 00:00:00 2001 From: Aaron Williamson Date: Mon, 3 Oct 2011 20:28:48 -0400 Subject: [PATCH] Reverse order of sanity checks: check email_verified after making sure there's a user in the request. --- mediagoblin/auth/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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() -- 2.25.1