fix: reload doctypes in recent patches

This commit is contained in:
Jannat Patel
2022-03-21 09:47:18 +05:30
parent 1b04615bff
commit 6c6e836f0d
3 changed files with 4 additions and 2 deletions

View File

@@ -22,5 +22,5 @@ school.patches.v0_0.add_progress_to_membership #20-10-2021
execute:frappe.delete_doc("Workspace", "LMS", ignore_missing=True, force=True) #24-10-2021
execute:frappe.delete_doc("Custom Field", "User-verify_age", ignore_missing=True, force=True)
school.patches.v0_0.multiple_instructors #11-02-2022
school.patches.v0_0.set_course_in_lesson #14-03-2022
school.patches.v0_0.set_status_in_course
school.patches.v0_0.set_course_in_lesson #21-03-2022
school.patches.v0_0.set_status_in_course #21-03-2022

View File

@@ -1,6 +1,7 @@
import frappe
def execute():
frappe.reload_doc("lms", "doctype", "course_lesson")
lessons = frappe.get_all("Course Lesson", fields=["name", "chapter"])
for lesson in lessons:
course = frappe.db.get_value("Course Chapter", lesson.chapter, "course")

View File

@@ -1,6 +1,7 @@
import frappe
def execute():
frappe.reload_doc("lms", "doctype", "lms_course")
courses = frappe.get_all("LMS Course", {"status": ("is", "not set")}, ["name", "is_published"])
for course in courses:
status = "Approved" if course.is_published else "In Progress"