chore: renamed lms certification to lms certificate

This commit is contained in:
Jannat Patel
2022-04-01 18:56:57 +05:30
parent e70c3ef939
commit ebfa49ed8e
14 changed files with 76 additions and 41 deletions

View File

@@ -0,0 +1,7 @@
import frappe
def execute():
frappe.reload_doc("lms", "doctype", "lms_certification")
certificates = frappe.get_all("LMS Certification", fields=["name", "student"])
for certificate in certificates:
frappe.db.set_value("LMS Certification", certificate.name, "member", certificate.student)

View File

@@ -0,0 +1,12 @@
import frappe
def execute():
old = frappe.get_all("LMS Certification", fields=["name", "course", "member", "student", "issue_date", "expiry_date"])
for data in old:
frappe.get_doc({
"doctype": "LMS Certificate",
"course": data.course,
"member": data.member or data.student,
"issue_date": data.issue_date,
"expiry_date": data.expiry_date
}).save(ignore_permissions=True)