diff --git a/community/lms/doctype/lms_batch/lms_batch.py b/community/lms/doctype/lms_batch/lms_batch.py index 0960cd13..16d1ec72 100644 --- a/community/lms/doctype/lms_batch/lms_batch.py +++ b/community/lms/doctype/lms_batch/lms_batch.py @@ -22,7 +22,7 @@ class LMSBatch(Document): frappe.throw(_("You are not a mentor of the course {0}").format(course.title)) def after_insert(self): - create_membership(batch=self.title, member_type="Mentor") + create_membership(batch=self.name, member_type="Mentor") def generate_code(self): short_code = frappe.db.get_value("LMS Course", self.course, "short_code") diff --git a/community/lms/doctype/lms_batch_membership/lms_batch_membership.py b/community/lms/doctype/lms_batch_membership/lms_batch_membership.py index 8cc24411..0d6db70d 100644 --- a/community/lms/doctype/lms_batch_membership/lms_batch_membership.py +++ b/community/lms/doctype/lms_batch_membership/lms_batch_membership.py @@ -28,7 +28,6 @@ class LMSBatchMembership(Document): member_name = frappe.db.get_value("Community Member", self.member, "full_name") frappe.throw(_("{0} is already a {1} of {2} course through {3} batch").format(member_name, membership.member_type, course, membership.batch)) -@frappe.whitelist() def create_membership(batch, member=None, member_type="Student", role="Member"): if not member: member = frappe.db.get_value("Community Member", {"email": frappe.session.user}, "name") diff --git a/community/www/courses/course.html b/community/www/courses/course.html index ba158579..ff51a3fc 100644 --- a/community/www/courses/course.html +++ b/community/www/courses/course.html @@ -111,11 +111,11 @@ {% endfor %} - Add a new batch + Add a new batch {% else %}

You are a mentor for this course.

- Create your first batch + Create your first batch
{% endif %} {% endmacro %}