Student and User link for LMS added
This commit is contained in:
parent
b3154efa84
commit
c84a318591
@ -63,7 +63,7 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 1,
|
||||||
"label": "Course",
|
"label": "Course",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@ -224,7 +224,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-11-25 19:06:07.261070",
|
"modified": "2018-12-06 11:53:08.006123",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Course Activity",
|
"name": "Course Activity",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -62,15 +62,6 @@ class Student(Document):
|
|||||||
enrollments = [item['program'] for item in program_enrollments]
|
enrollments = [item['program'] for item in program_enrollments]
|
||||||
return 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):
|
def enroll_in_program(self, program_name):
|
||||||
enrollment = frappe.get_doc({
|
enrollment = frappe.get_doc({
|
||||||
"doctype": "Program Enrollment",
|
"doctype": "Program Enrollment",
|
||||||
|
|||||||
@ -106,6 +106,7 @@ def create_student():
|
|||||||
"first_name": user.first_name,
|
"first_name": user.first_name,
|
||||||
"last_name": user.last_name,
|
"last_name": user.last_name,
|
||||||
"student_email_id": user.email,
|
"student_email_id": user.email,
|
||||||
|
"user": frappe.session.user
|
||||||
})
|
})
|
||||||
student.save(ignore_permissions=True)
|
student.save(ignore_permissions=True)
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user