Commit 8f4ef8bc authored by Zosman's avatar Zosman
Browse files

This commit tests a possible way to actually block users

parent e15979df
Pipeline #435 passed with stage
in 7 minutes and 17 seconds
......@@ -30,13 +30,17 @@ def index(request):
get the URL registration form.
"""
# If the user is blocked, redirect them to the blocked page.
if request.user.registereduser.blocked:
return render(request, 'blocked.html')
# If the user is not authenticated, show them a public landing page.
if not request.user.is_authenticated():
elif not request.user.is_authenticated():
return render(request, 'public_landing.html')
# If the user isn't approved, don't give them any leeway.
elif not request.user.registereduser.approved:
return render(request, 'not_registered.html')
url_form = URLForm(host=request.META.get('HTTP_HOST')) # unbound form
if request.method == 'POST':
......
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