Commit 91ce88d8 authored by Chris Reffett's avatar Chris Reffett
Browse files

Rename is_registered to is_approved

parent 27088b47
...@@ -19,7 +19,7 @@ Define useful helper methods here. ...@@ -19,7 +19,7 @@ Define useful helper methods here.
""" """
def is_registered( user ): def is_approved( user ):
""" """
This function checks if a user account has a corresponding RegisteredUser, This function checks if a user account has a corresponding RegisteredUser,
thus checking if the user is registered. thus checking if the user is registered.
...@@ -73,7 +73,7 @@ def index(request): ...@@ -73,7 +73,7 @@ def index(request):
""" """
# If the user isn't registered, don't give them any leeway. # If the user isn't registered, don't give them any leeway.
if not is_registered(request.user): if not is_approved(request.user):
return render(request, 'not_registered.html') return render(request, 'not_registered.html')
url_form = URLForm() # unbound form url_form = URLForm() # unbound form
...@@ -152,7 +152,7 @@ def my_links(request): ...@@ -152,7 +152,7 @@ def my_links(request):
obviously need to be logged in to view your URLs. obviously need to be logged in to view your URLs.
""" """
if not is_registered(request.user): if not is_approved(request.user):
return render(request, 'not_registered.html') return render(request, 'not_registered.html')
urls = URL.objects.filter( owner = request.user ) urls = URL.objects.filter( owner = request.user )
...@@ -169,7 +169,7 @@ def delete(request, short): ...@@ -169,7 +169,7 @@ def delete(request, short):
logged in and registered, and must also be the owner of the URL. logged in and registered, and must also be the owner of the URL.
""" """
if not is_registered(request.user): if not is_approved(request.user):
return render(request, 'not_registered.html') return render(request, 'not_registered.html')
url = get_object_or_404(URL, short__iexact = short ) url = get_object_or_404(URL, short__iexact = short )
......
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