fix: remove unnecessary schemes and minor changes

This commit is contained in:
Abhishek Balam 2021-05-02 00:32:01 +05:30
parent 024e759a70
commit f4e4fc98f9
3 changed files with 3 additions and 3 deletions

View file

@ -55,7 +55,7 @@ class EventProducer(Document):
self.reload()
def check_url(self):
valid_url_schemes = ("http", "https", "ftp", "ftps")
valid_url_schemes = ("http", "https")
frappe.utils.validate_url(self.producer_url, throw=True, valid_schemes=valid_url_schemes)
# remove '/' from the end of the url like http://test_site.com/

View file

@ -154,7 +154,7 @@ class TestValidationUtils(unittest.TestCase):
self.assertRaises(
frappe.ValidationError,
validate_url,
'bitcoin://joker.edu',
'gopher://frappe.io',
valid_schemes='https',
throw=True
)

View file

@ -157,7 +157,7 @@ def split_emails(txt):
def validate_url(txt, throw=False, valid_schemes=None):
"""
Tests wether the `txt` is a valid URL
Checks whether `txt` has a valid URL string
Parameters:
throw (`bool`): throws a validationError if URL is not valid