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
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user