fix: field cleanup

This commit is contained in:
Jannat Patel
2022-03-24 18:59:58 +05:30
parent 2b348916f4
commit 77df068fea
14 changed files with 21 additions and 67 deletions

View File

@@ -2,7 +2,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"])
courses = frappe.get_all("LMS Course", {"status": ("is", "not set")}, ["name", "published"])
for course in courses:
status = "Approved" if course.is_published else "In Progress"
status = "Approved" if course.published else "In Progress"
frappe.db.set_value("LMS Course", course.name, "status", status)