Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: onboarding data update #1240

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading