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
2b95a071
Commit
2b95a071
authored
Mar 18, 2017
by
Zach Knox
Browse files
Fixed login requirements to make sense with new layout
parent
3961d833
Pipeline
#1100
passed with stage
in 1 minute
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/views.py
View file @
2b95a071
...
...
@@ -28,13 +28,10 @@ from datetime import timedelta
not_registered error page. If they are logged in AND registered, they
get the URL registration form.
"""
@
login_required
def
new_link
(
request
):
# If the user is blocked, redirect them to the blocked page.
# If the user is not authenticated, show them a public landing page.
if
not
request
.
user
.
is_authenticated
():
return
render
(
request
,
'public_landing.html'
)
# If the user isn't approved, then display the you're not approved page.
el
if
not
request
.
user
.
registereduser
.
approved
:
if
not
request
.
user
.
registereduser
.
approved
:
if
request
.
user
.
registereduser
.
blocked
:
return
render
(
request
,
'banned.html'
)
else
:
...
...
@@ -141,9 +138,11 @@ def view(request, short):
This view displays all the information about all of your URLs. You
obviously need to be logged in to view your URLs.
"""
@
login_required
def
index
(
request
):
def
index
(
request
):
# If the user is not authenticated, show them a public landing page.
if
not
request
.
user
.
is_authenticated
():
return
render
(
request
,
'public_landing.html'
)
# Do not display this page to unapproved users
if
not
request
.
user
.
registereduser
.
approved
:
return
render
(
request
,
'not_registered.html'
)
...
...
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