From: Aleksandar Micovic Date: Tue, 31 May 2011 19:26:00 +0000 (-0400) Subject: Fixed bug where someone who wasn't logged in was asked to verify X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bcec749b52c287a6d361fd06bfbd833e03e5b478;p=mediagoblin.git Fixed bug where someone who wasn't logged in was asked to verify their emails. --- diff --git a/mediagoblin/decorators.py b/mediagoblin/decorators.py index bb625667..bc12d61c 100644 --- a/mediagoblin/decorators.py +++ b/mediagoblin/decorators.py @@ -36,12 +36,13 @@ def require_active_login(controller): Require an active login from the user. """ def new_controller_func(request, *args, **kwargs): - if not request.user or not request.user.get('status') == u'active': - # TODO: Indicate to the user that they were redirected - # here because an *active* user is required. + if request.user and request.user.get('status') == u'needs_email_verification': + return exc.HTTPFound( + location = request.urlgen('mediagoblin.auth.verify_email_notice')) + elif not request.user or request.user.get('status') != u'active': return exc.HTTPFound( location="%s?next=%s" % ( - request.urlgen("mediagoblin.auth.verify_email_notice"), + request.urlgen("mediagoblin.auth.login"), request.path_info)) return controller(request, *args, **kwargs)