Commit 21564865 authored by David Haynes's avatar David Haynes 🙆
Browse files

Merge branch '145-linkNotFoundPage' into '2.2-dev'

Resolve "Display a "this link does not exist" page when navigating to a non existent Go link"

See merge request !95
parents 0f5f9af4 7933bb5f
Pipeline #1309 passed with stage
in 2 minutes and 10 seconds
......@@ -452,7 +452,11 @@ def redirection(request, short):
url = get_object_or_404(URL, short__iexact=short)
# Increment our clicks by one
url.clicks += 1
# Get the URL short link
doesExist = URL.objects.get(short__iexact=short)
# Checks to see if the link exists, if not we 404 the user.
if is None:
return redirect('go/404.html')
# If the user is trying to make a Go link to itself, we 404 them
if == domain + short:
return redirect('404.html')
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