Changed url validator to add http instead of https to the beginning of urls

This commit is contained in:
xemeds
2020-07-20 18:55:07 +00:00
parent c091efe84d
commit c6343893f4
3 changed files with 3 additions and 3 deletions
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -31,8 +31,8 @@ def validate_URL(form, field):
# If the URL does not start with http:// and https://
if not(field.data.startswith("http://")) and not(field.data.startswith("https://")):
# Add https:// to the beginning of the URL
field.data = "https://" + field.data
# Add http:// to the beginning of the URL
field.data = "http://" + field.data
class URLForm(FlaskForm):
+1 -1
View File
@@ -52,4 +52,4 @@ def error_404(error):
@app.errorhandler(500)
def error_500(error):
return render_template("error.html", error_message="500 Internal Server Error"), 500
return render_template("error.html", error_message="500 Internal Server Error"), 500