diff --git a/lms/__init__.py b/lms/__init__.py index 5becc17c..8c0d5d5b 100644 --- a/lms/__init__.py +++ b/lms/__init__.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "2.0.0" diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index ff9edb15..5883c4d1 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -28,6 +28,7 @@ class LMSBatch(Document): def validate(self): if self.seat_count: self.validate_seats_left() + self.validate_batch_end_date() self.validate_duplicate_courses() self.validate_duplicate_students() self.validate_duplicate_assessments() @@ -36,6 +37,10 @@ class LMSBatch(Document): self.send_confirmation_mail() self.validate_evaluation_end_date() + def validate_batch_end_date(self): + if self.end_date < self.start_date: + frappe.throw(_("Batch end date cannot be before the batch start date")) + def validate_duplicate_students(self): students = [row.student for row in self.students] duplicates = {student for student in students if students.count(student) > 1}