From 143e992ede224c4fe87b0fe52ba37e2fa2b8ad01 Mon Sep 17 00:00:00 2001 From: xemeds Date: Mon, 17 Aug 2020 09:59:57 +0300 Subject: [PATCH] Added a custom message for invalid URLs that contain the websites domain --- tiny0/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny0/forms.py b/tiny0/forms.py index fe55f67..ef24ee6 100644 --- a/tiny0/forms.py +++ b/tiny0/forms.py @@ -32,7 +32,7 @@ def validate_URL(form, field): # If the url contains the websites domain if WEBSITE_DOMAIN in field.data.lower(): # Raise a ValidationError - raise ValidationError("Invalid URL") + raise ValidationError("Yeah, that's definitely a valid URL") # If the URL does not start with http:// and https:// if not(field.data.lower().startswith("http://")) and not(field.data.lower().startswith("https://")):