Commit 0b0fd220 authored by David Haynes's avatar David Haynes 🙆
Browse files

Merge branch '2.2-dev' of git.gmu.edu:srct/go into 2.2-dev

parents 409d57cd b0293d82
Pipeline #1254 passed with stage
in 1 minute and 22 seconds
......@@ -134,14 +134,13 @@ class URL(models.Model):
"""
if cache.get("hashids_counter") is None:
cache.set("hashids_counter", URL.objects.count())
cache.incr("hashids_counter")
short = HASHIDS.encrypt(cache.get("hashids_counter"))
tries = 1
while tries < 100:
try:
URL.objects.get(short__iexact=short)
short = HASHIDS.encrypt(cache.get("hashids_counter"))
tries += 1
cache.incr("hashids_counter")
URL.objects.get(short__iexact=short)
except URL.DoesNotExist as ex:
print(ex)
return short
......
......@@ -103,7 +103,7 @@ SRCT Go &bull; About
<br></br>
Go 1.0:
<br />
<a href="https://github.com/jrouly">Michel Rouley</a>,
<a href="https://github.com/jrouly">Michel Rouly</a>,
<a href="https://github.com/creffett">Chris Reffett</a>,
<a href="https://github.com/nanderson94">Nicholas Anderson</a>,
and <a href="https://github.com/akshaykarthik">Akshay Karthik</a>.
......
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