fix: remove unnecessary schemes and minor changes
This commit is contained in:
parent
024e759a70
commit
f4e4fc98f9
3 changed files with 3 additions and 3 deletions
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue