From 507d08f37cfd5c74b64f6b1af30e0933742cfc61 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 10 Jan 2025 15:04:08 +0530 Subject: [PATCH] fix: onboarding data update --- lms/lms/utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 59d3ea575..6e84f7f6c 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -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") @@ -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,