From fe791dc478c327c648bd23e90ea3844f7bf7332d Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 25 Jan 2024 15:45:27 +0530 Subject: [PATCH 1/5] fix: batch self enrollment --- lms/lms/doctype/batch_student/batch_student.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lms/lms/doctype/batch_student/batch_student.py b/lms/lms/doctype/batch_student/batch_student.py index d3168f71..733b989e 100644 --- a/lms/lms/doctype/batch_student/batch_student.py +++ b/lms/lms/doctype/batch_student/batch_student.py @@ -11,6 +11,10 @@ class BatchStudent(Document): @frappe.whitelist() def enroll_batch(batch_name): + if frappe.db.exists( + "Batch Student", {"student": frappe.session.user, "parent": batch_name} + ): + frappe.throw("You are already enrolled in this batch") enrollment = frappe.new_doc("Batch Student") enrollment.student = frappe.session.user enrollment.parent = batch_name From 8f687145be557a829db3ab6e32892c398aa47b32 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 25 Jan 2024 23:13:43 +0530 Subject: [PATCH 2/5] fix: pricing issue --- lms/www/billing/billing.html | 2 +- lms/www/billing/billing.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lms/www/billing/billing.html b/lms/www/billing/billing.html index b97ca3b3..ae344328 100644 --- a/lms/www/billing/billing.html +++ b/lms/www/billing/billing.html @@ -38,7 +38,7 @@
{{ _("Total Price: ") }} - {{ frappe.utils.fmt_money(amount, 2, currency) }} + {{ frappe.utils.fmt_money(amount_with_gst, 2, currency) if gst_applied else frappe.utils.fmt_money(amount, 2, currency) }}
{% if gst_applied %} diff --git a/lms/www/billing/billing.py b/lms/www/billing/billing.py index 7742f730..edb21e98 100644 --- a/lms/www/billing/billing.py +++ b/lms/www/billing/billing.py @@ -17,9 +17,7 @@ def get_context(context): context.original_currency = context.currency context.original_amount = ( - apply_gst(context.amount, None)[0] - if context.original_currency == "INR" - else context.amount + (context.amount * 1.18) if context.original_currency == "INR" else context.amount ) context.exception_country = frappe.get_all( @@ -32,7 +30,7 @@ def get_context(context): context.address = get_address() if context.currency == "INR": - context.amount, context.gst_applied = apply_gst(context.amount, None) + context.amount_with_gst, context.gst_applied = apply_gst(context.amount, None) def validate_access(doctype, docname, module): From 3dad3580bb076c77b0d0580fc7b6903660477147 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 1 Feb 2024 10:52:23 +0530 Subject: [PATCH 3/5] fix: batch self enrollment --- lms/www/batches/batch_details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/www/batches/batch_details.html b/lms/www/batches/batch_details.html index ddfbba43..bf24e971 100644 --- a/lms/www/batches/batch_details.html +++ b/lms/www/batches/batch_details.html @@ -150,7 +150,7 @@ href="/billing/batch/{{ batch_info.name }}"> {{ _("Register Now") }} - {% elif batch_info.allow_self_enrollment %} + {% elif batch_info.allow_self_enrollment and batch_info.seat_count and seats_left %} From ff1bd91223ba24d57095d94ed6df0d5d3db8a8f3 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 5 Feb 2024 23:06:26 +0530 Subject: [PATCH 4/5] feat: cohort description --- lms/www/cohorts/cohort.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lms/www/cohorts/cohort.html b/lms/www/cohorts/cohort.html index f604ce2d..08f07988 100644 --- a/lms/www/cohorts/cohort.html +++ b/lms/www/cohorts/cohort.html @@ -1,6 +1,11 @@ {% extends "www/cohorts/base.html" %} {% block title %} {{ _("Manage") }} {{ course.title }} {% endblock %} {% block page_content %}
{{ cohort.title }}
+{% if cohort.description %} +
+ {{ frappe.utils.md_to_html(cohort.description) }} +
+{% endif %}

{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{ From b0bb7d32caae23a5db0701c000045058dcd65352 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 6 Feb 2024 10:12:49 +0530 Subject: [PATCH 5/5] chore: capture active sites --- lms/www/courses/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lms/www/courses/index.html b/lms/www/courses/index.html index 52ea23f7..f073a4b8 100644 --- a/lms/www/courses/index.html +++ b/lms/www/courses/index.html @@ -169,3 +169,8 @@ {% endblock %} +{% block script %} + +{% endblock %}