revert: class registration

This commit is contained in:
Jannat Patel
2023-08-18 18:59:02 +05:30
parent b7783659c9
commit 575fb623ba
8 changed files with 41 additions and 146 deletions

View File

@@ -0,0 +1,23 @@
import frappe
def execute():
if frappe.db.exists("DocType", "Class Student Registration"):
frappe.reload_doc("lms", "doctype", "class_student")
students = frappe.get_all("Class Student", fields=["name", "student"])
for student in students:
student_details = frappe.db.get_value(
"User", student.student, ["full_name", "username"], as_dict=1
)
frappe.db.set_value(
"Class Student",
student.name,
{
"class_student": None,
"student_name": student_details.full_name,
"username": student_details.username,
},
)
frappe.delete_doc("DocType", "Class Student Registration")