Files
enlight-lms/lms/patches/v0_0/convert_course_description_to_html.py
2023-04-06 18:01:12 +05:30

13 lines
336 B
Python

import frappe
from lms.lms.md import markdown_to_html
def execute():
courses = frappe.get_all("LMS Course", fields=["name", "description"])
for course in courses:
html = markdown_to_html(course.description)
frappe.db.set_value("LMS Course", course.name, "description", html)
frappe.reload_doc("lms", "doctype", "lms_course")