Commit a7c97649 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Handle empty short URLs by adding in a randomized new short value.

parent 24c9403a
......@@ -23,7 +23,10 @@ def index(request):
url.owner = request.user
short = url_form.cleaned_data.get('short').strip()
url.short = short
if len(short) > 0:
url.short = short
else:
url.short = URL.generate_valid_short()
expires = url_form.cleaned_data.get('expires')
......
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