fix: validate url starts with http or https for job form
This commit is contained in:
@@ -16,7 +16,7 @@ class JobOpportunity(Document):
|
|||||||
self.company_logo = validate_image(self.company_logo)
|
self.company_logo = validate_image(self.company_logo)
|
||||||
|
|
||||||
def validate_urls(self):
|
def validate_urls(self):
|
||||||
validate_url(self.company_website, True, ["http://", "https://"])
|
validate_url(self.company_website, True, ["http", "https"])
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
if not self.name:
|
if not self.name:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class LMSAssignmentSubmission(Document):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def validate_url(self):
|
def validate_url(self):
|
||||||
if self.type == "URL" and not validate_url(self.answer, True, ["http://", "https://"]):
|
if self.type == "URL" and not validate_url(self.answer, True, ["http", "https"]):
|
||||||
frappe.throw(_("Please enter a valid URL."))
|
frappe.throw(_("Please enter a valid URL."))
|
||||||
|
|
||||||
def validate_status(self):
|
def validate_status(self):
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class LMSSettings(Document):
|
|||||||
def validate_contact_us_details(self):
|
def validate_contact_us_details(self):
|
||||||
if self.contact_us_email and not validate_email_address(self.contact_us_email):
|
if self.contact_us_email and not validate_email_address(self.contact_us_email):
|
||||||
frappe.throw(_("Please enter a valid Contact Us Email."))
|
frappe.throw(_("Please enter a valid Contact Us Email."))
|
||||||
if self.contact_us_url and not validate_url(self.contact_us_url, True, ["http://", "https://"]):
|
if self.contact_us_url and not validate_url(self.contact_us_url, True, ["http", "https"]):
|
||||||
frappe.throw(_("Please enter a valid Contact Us URL."))
|
frappe.throw(_("Please enter a valid Contact Us URL."))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user