feat: added portal page to join a cohort

Issue #271
This commit is contained in:
Anand Chitipothu
2021-11-30 08:29:24 +05:30
parent 1277cfed64
commit f1157895db
5 changed files with 142 additions and 0 deletions

View File

@@ -213,6 +213,10 @@ class LMSCourse(Document):
def get_cohorts(self):
return find_all("Cohort", course=self.name, order_by="creation")
def get_cohort(self, cohort_slug):
name = frappe.get_value("Cohort", {"course": self.name, "slug": cohort_slug})
return name and frappe.get_doc("Cohort", name)
def is_cohort_staff(self, user_email):
"""Returns True if the user is either a mentor or a staff for one or more active cohorts of this course.
"""