Skip to content

Commit

Permalink
fix: onboarding data update
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Jan 10, 2025
1 parent 40c295a commit 507d08f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lms/lms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,17 @@ def get_telemetry_boot_info():


def is_onboarding_complete():
onboarding_status = frappe.db.get_single_value(
"LMS Settings", "is_onboarding_complete"
)
if onboarding_status:
return {
"is_onboarded": onboarding_status,
"course_created": True,
"chapter_created": True,
"lesson_created": True,
"first_course": None,
}
course_created = frappe.db.a_row_exists("LMS Course")
chapter_created = frappe.db.a_row_exists("Course Chapter")
lesson_created = frappe.db.a_row_exists("Course Lesson")
Expand All @@ -835,7 +846,7 @@ def is_onboarding_complete():
frappe.db.set_single_value("LMS Settings", "is_onboarding_complete", 1)

return {
"is_onboarded": frappe.db.get_single_value("LMS Settings", "is_onboarding_complete"),
"is_onboarded": onboarding_status,
"course_created": course_created,
"chapter_created": chapter_created,
"lesson_created": lesson_created,
Expand Down

0 comments on commit 507d08f

Please sign in to comment.