fix: Auto course enrollment for enrolled programs in LMS
This commit is contained in:
parent
a0978a2aab
commit
5c646e60f5
@ -115,7 +115,7 @@ def create_student_from_current_user():
|
||||
def enroll_in_course(course_name, program_name):
|
||||
student_id = get_current_student()
|
||||
student = frappe.get_doc("Student", student_id)
|
||||
student.enroll_in_course(course_name=course_name, program_enrollment=get_program_enrollment(program_name))
|
||||
return student.enroll_in_course(course_name=course_name, program_enrollment=get_program_enrollment(program_name))
|
||||
|
||||
def check_activity_exists(enrollment, content_type, content):
|
||||
activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment, 'content_type': content_type, 'content': content})
|
||||
|
@ -180,7 +180,7 @@ def get_course_meta(course_name, program_name):
|
||||
if not program_enrollment:
|
||||
return None
|
||||
if not course_enrollment:
|
||||
utils.enroll_in_course(course_name, program_name)
|
||||
course_enrollment = utils.enroll_in_course(course_name, program_name)
|
||||
progress = course_enrollment.get_progress(student)
|
||||
count = sum([activity['is_complete'] for activity in progress])
|
||||
if count == 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user