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",

View File

@ -205,6 +205,39 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "user",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User ID",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@ -1188,7 +1221,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2018-11-08 12:26:01.047163",
"modified": "2018-12-06 13:03:54.345969",
"modified_by": "Administrator",
"module": "Education",
"name": "Student",

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()