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
94b06409
Commit
94b06409
authored
Jan 12, 2016
by
David Haynes
🙆
Browse files
Fix minor issues (doc, #'s, and more template errors)
- a very productive day
parent
ff607638
Changes
3
Hide whitespace changes
Inline
Side-by-side
go/go/forms.py
View file @
94b06409
...
...
@@ -16,6 +16,7 @@ class URLForm(forms.ModelForm):
})
)
# Check to make sure the short url has not been used
def
unique_short
(
value
):
try
:
URL
.
objects
.
get
(
short__iexact
=
value
)
...
...
go/go/models.py
View file @
94b06409
...
...
@@ -43,7 +43,7 @@ class URL(models.Model):
tries
=
1
while
tries
<
100
:
try
:
#
urls = URL.objects.get(short__iexact=short)
urls
=
URL
.
objects
.
get
(
short__iexact
=
short
)
tries
+=
1
hashids_counter
+=
1
except
URL
.
DoesNotExist
:
...
...
go/go/views.py
View file @
94b06409
...
...
@@ -117,7 +117,7 @@ def index(request):
random_short
=
URL
.
generate_valid_short
()
if
random_short
is
None
:
return
HttpResponseServerError
(
render
(
request
,
'
core/
500.html'
,
{})
render
(
request
,
'500.html'
,
{})
)
else
:
url
.
short
=
random_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