Commit 812b868d authored by David Haynes's avatar David Haynes
Browse files

Even better redirects

- proper order, plus direct redirect with no logic needed -- the :dhaynes: way
parent 551452e8
......@@ -151,10 +151,10 @@ def signup(request):
This view presents the user with a registration form. You can register yourself.
"""
# Do not display signup page to registered or approved users (Staff can still see these pages)
if request.user.registereduser.registered and not request.user.is_staff:
return render(request, 'registered.html', {})
elif request.user.registereduser.approved and not request.user.is_staff:
return render(request, 'core/index.html', {})
if request.user.registereduser.approved and not request.user.is_staff:
return redirect('/')
elif request.user.registereduser.registered and not request.user.is_staff:
return redirect('registered')
signup_form = SignupForm(request)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment