fix: unavailability validations
This commit is contained in:
@@ -21,7 +21,11 @@ class CourseEvaluator(Document):
|
|||||||
if self.unavailable_to and not self.unavailable_from:
|
if self.unavailable_to and not self.unavailable_from:
|
||||||
frappe.throw(_("Unavailable From Date is mandatory if Unavailable To Date is set"))
|
frappe.throw(_("Unavailable From Date is mandatory if Unavailable To Date is set"))
|
||||||
|
|
||||||
if self.unavailable_from >= self.unavailable_to:
|
if (
|
||||||
|
self.unavailable_from
|
||||||
|
and self.unavailable_to
|
||||||
|
and self.unavailable_from >= self.unavailable_to
|
||||||
|
):
|
||||||
frappe.throw(_("Unavailable From Date cannot be greater than Unavailable To Date"))
|
frappe.throw(_("Unavailable From Date cannot be greater than Unavailable To Date"))
|
||||||
|
|
||||||
def validate_time_slots(self):
|
def validate_time_slots(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user