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
91ce88d8
Commit
91ce88d8
authored
Aug 30, 2014
by
Chris Reffett
Browse files
Rename is_registered to is_approved
parent
27088b47
Changes
1
Show whitespace changes
Inline
Side-by-side
go/go/views.py
View file @
91ce88d8
...
...
@@ -19,7 +19,7 @@ Define useful helper methods here.
"""
def
is_
register
ed
(
user
):
def
is_
approv
ed
(
user
):
"""
This function checks if a user account has a corresponding RegisteredUser,
thus checking if the user is registered.
...
...
@@ -73,7 +73,7 @@ def index(request):
"""
# If the user isn't registered, don't give them any leeway.
if
not
is_
register
ed
(
request
.
user
):
if
not
is_
approv
ed
(
request
.
user
):
return
render
(
request
,
'not_registered.html'
)
url_form
=
URLForm
()
# unbound form
...
...
@@ -152,7 +152,7 @@ def my_links(request):
obviously need to be logged in to view your URLs.
"""
if
not
is_
register
ed
(
request
.
user
):
if
not
is_
approv
ed
(
request
.
user
):
return
render
(
request
,
'not_registered.html'
)
urls
=
URL
.
objects
.
filter
(
owner
=
request
.
user
)
...
...
@@ -169,7 +169,7 @@ def delete(request, short):
logged in and registered, and must also be the owner of the URL.
"""
if
not
is_
register
ed
(
request
.
user
):
if
not
is_
approv
ed
(
request
.
user
):
return
render
(
request
,
'not_registered.html'
)
url
=
get_object_or_404
(
URL
,
short__iexact
=
short
)
...
...
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