Student and User link for LMS added

This commit is contained in:
scmmishra 2018-12-06 20:17:39 +05:30 committed by Aditya Hase
parent b3154efa84
commit c84a318591
4 changed files with 1235 additions and 1210 deletions

View File

@ -63,7 +63,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"in_standard_filter": 1,
"label": "Course",
"length": 0,
"no_copy": 0,
@ -224,7 +224,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-11-25 19:06:07.261070",
"modified": "2018-12-06 11:53:08.006123",
"modified_by": "Administrator",
"module": "Education",
"name": "Course Activity",

File diff suppressed because it is too large Load Diff

View File

@ -62,15 +62,6 @@ class Student(Document):
enrollments = [item['program'] for item in program_enrollments]
return enrollments
def get_completed_courses(self):
"""Returns a list of course enrollments linked with the current student"""
completed_courses = frappe.get_list("Course Enrollment", filters={"student": self.name, "completed":1}, fields=['course'])
if not completed_courses:
return None
else:
courses = [item['course'] for item in completed_courses]
return courses
def enroll_in_program(self, program_name):
enrollment = frappe.get_doc({
"doctype": "Program Enrollment",

View File

@ -106,6 +106,7 @@ def create_student():
"first_name": user.first_name,
"last_name": user.last_name,
"student_email_id": user.email,
"user": frappe.session.user
})
student.save(ignore_permissions=True)
frappe.db.commit()