Skip to content
Snippets Groups Projects
Commit 5ba11e77 authored by Jonas Leder's avatar Jonas Leder
Browse files

bugfix

parent d4045482
Branches
Tags
Loading
Pipeline #53 passed
......@@ -144,8 +144,6 @@ def home_get():
@app.route('/', methods=['POST']) #This function is used to create a new url
def home_post():
if not grecaptcha_verify(request) and not skipCaptcha:
return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, snackbar="There was an error validating, that you are a human, please try again.", long_url_prefilled=request.form.get('url'), short_url_prefilled=request.form.get('short').lower(), domain_prefilled=domain_to_index[request.form.get('domain')], recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar) #return the user the prefilled form with an error message, because no url to short was provided
try:
userID = request.cookies.get('userID')
......@@ -153,6 +151,8 @@ def home_post():
except:
userID = "null"
loginbar = '<a href="/user/login" style="color:white">login</a>'
if not grecaptcha_verify(request) and not skipCaptcha:
return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, snackbar="There was an error validating, that you are a human, please try again.", long_url_prefilled=request.form.get('url'), short_url_prefilled=request.form.get('short').lower(), domain_prefilled=domain_to_index[request.form.get('domain')], recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar) #return the user the prefilled form with an error message, because no url to short was provided
if (request.form.get('url').replace(" ", "") == ""):
return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, snackbar="Please enter a url to short, before submitting this form", long_url_prefilled=request.form.get('url'), short_url_prefilled=request.form.get('short').lower(), domain_prefilled=domain_to_index[request.form.get('domain')], recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar) #return the user the prefilled form with an error message, because no url to short was provided
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment