fix: certificate share

This commit is contained in:
Jannat Patel
2023-08-09 14:29:51 +05:30
parent d83d6cf2d8
commit 4660240395
3 changed files with 36 additions and 15 deletions

View File

@@ -30,7 +30,7 @@ def get_context(context):
)
context.url = f"{get_url()}/courses/{context.course.name}/{context.doc.name}"
default_print_format = frappe.db.get_value(
print_format = frappe.db.get_value(
"Property Setter",
{
"doc_type": "LMS Certificate",
@@ -40,8 +40,11 @@ def get_context(context):
as_dict=True,
)
if not print_format:
print_format = "Certificate"
template = frappe.db.get_value(
"Print Format", default_print_format.value, ["html", "css"], as_dict=True
"Print Format", print_format.value, ["html", "css"], as_dict=True
)
merged_template = "<style> " + template.css + " </style>" + template.html
final_template = render_template(merged_template, context)