feat: certificate pdf and custom certificate
This commit is contained in:
25
lms/patches/v0_0/share_certificates.py
Normal file
25
lms/patches/v0_0/share_certificates.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
certificates = frappe.get_all("LMS Certificate", fields=["member", "name"])
|
||||
|
||||
for certificate in certificates:
|
||||
if not frappe.db.exists(
|
||||
"DocShare",
|
||||
{
|
||||
"share_doctype": "LMS Certificate",
|
||||
"share_name": certificate.name,
|
||||
"user": certificate.member,
|
||||
},
|
||||
):
|
||||
share = frappe.get_doc(
|
||||
{
|
||||
"doctype": "DocShare",
|
||||
"user": certificate.member,
|
||||
"share_doctype": "LMS Certificate",
|
||||
"share_name": certificate.name,
|
||||
"read": 1,
|
||||
}
|
||||
)
|
||||
share.save(ignore_permissions=True)
|
||||
Reference in New Issue
Block a user