Commit e94df0dc authored by Eyad Hasan's avatar Eyad Hasan
Browse files

Added comments

parent ed835333
Pipeline #1123 passed with stage
in 1 minute and 9 seconds
......@@ -350,10 +350,14 @@ 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 doesExist.target is None:
return redirect('go/404.html')
# If the user is trying to make a Go link to itself, we 404 them
if url.target == domain + short:
return redirect('admin/404.html')
return redirect('go/404.html')
# If the user is coming from a QR request then increment qrclicks
if 'qr' in request.GET:
......
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