fix: misc ui issues

This commit is contained in:
Jannat Patel
2025-05-13 20:04:06 +05:30
parent d9d031ed2b
commit 0a71620046
22 changed files with 2904 additions and 166 deletions

View File

@@ -23,6 +23,7 @@ class LMSBatch(Document):
def validate(self):
self.validate_seats_left()
self.validate_batch_end_date()
self.validate_batch_time()
self.validate_duplicate_courses()
self.validate_payments_app()
self.validate_amount_and_currency()
@@ -39,6 +40,11 @@ class LMSBatch(Document):
if self.end_date < self.start_date:
frappe.throw(_("Batch end date cannot be before the batch start date"))
def validate_batch_time(self):
if self.start_time and self.end_time:
if get_time(self.start_time) >= get_time(self.end_time):
frappe.throw(_("Batch start time cannot be greater than or equal to end time."))
def validate_duplicate_courses(self):
courses = [row.course for row in self.courses]
duplicates = {course for course in courses if courses.count(course) > 1}

View File

@@ -11,9 +11,11 @@
<b>{{ _("Batch Start Date:") }}</b> {{ frappe.utils.format_date(start_date, "medium") }}
</p>
{% if medium %}
<p>
<b>{{ _("Medium:") }}</b> {{ medium }}
</p>
{% endif %}
<p>
<b>{{ _("Timings:") }}</b> {{ frappe.utils.format_time(start_time, "hh:mm a") }}