Changed url validator to add http instead of https to the beginning of urls
This commit is contained in:
Binary file not shown.
+2
-2
@@ -31,8 +31,8 @@ def validate_URL(form, field):
|
|||||||
|
|
||||||
# If the URL does not start with http:// and https://
|
# If the URL does not start with http:// and https://
|
||||||
if not(field.data.startswith("http://")) and not(field.data.startswith("https://")):
|
if not(field.data.startswith("http://")) and not(field.data.startswith("https://")):
|
||||||
# Add https:// to the beginning of the URL
|
# Add http:// to the beginning of the URL
|
||||||
field.data = "https://" + field.data
|
field.data = "http://" + field.data
|
||||||
|
|
||||||
|
|
||||||
class URLForm(FlaskForm):
|
class URLForm(FlaskForm):
|
||||||
|
|||||||
+1
-1
@@ -52,4 +52,4 @@ def error_404(error):
|
|||||||
|
|
||||||
@app.errorhandler(500)
|
@app.errorhandler(500)
|
||||||
def error_500(error):
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user