Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
8f4ef8bc
Commit
8f4ef8bc
authored
Nov 09, 2016
by
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
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
go/go/views.py
View file @
8f4ef8bc
...
...
@@ -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
():
el
if
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'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment