fix: reload doctypes in recent patches
This commit is contained in:
@@ -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("Workspace", "LMS", ignore_missing=True, force=True) #24-10-2021
|
||||||
execute:frappe.delete_doc("Custom Field", "User-verify_age", ignore_missing=True, force=True)
|
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.multiple_instructors #11-02-2022
|
||||||
school.patches.v0_0.set_course_in_lesson #14-03-2022
|
school.patches.v0_0.set_course_in_lesson #21-03-2022
|
||||||
school.patches.v0_0.set_status_in_course
|
school.patches.v0_0.set_status_in_course #21-03-2022
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc("lms", "doctype", "course_lesson")
|
||||||
lessons = frappe.get_all("Course Lesson", fields=["name", "chapter"])
|
lessons = frappe.get_all("Course Lesson", fields=["name", "chapter"])
|
||||||
for lesson in lessons:
|
for lesson in lessons:
|
||||||
course = frappe.db.get_value("Course Chapter", lesson.chapter, "course")
|
course = frappe.db.get_value("Course Chapter", lesson.chapter, "course")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc("lms", "doctype", "lms_course")
|
||||||
courses = frappe.get_all("LMS Course", {"status": ("is", "not set")}, ["name", "is_published"])
|
courses = frappe.get_all("LMS Course", {"status": ("is", "not set")}, ["name", "is_published"])
|
||||||
for course in courses:
|
for course in courses:
|
||||||
status = "Approved" if course.is_published else "In Progress"
|
status = "Approved" if course.is_published else "In Progress"
|
||||||
|
|||||||
Reference in New Issue
Block a user