fix: restrict profile and mark as complete

This commit is contained in:
Jannat Patel
2021-12-21 11:11:39 +05:30
parent ea06fe8cf8
commit ff702c9d14
21 changed files with 110 additions and 45 deletions

View File

@@ -86,6 +86,17 @@ class LiveCodeExtension(PageExtension):
"templates/livecode/extension_footer.html",
context)
def set_mandatory_fields_for_profile():
profile_form = frappe.get_doc("Web Form", "profile")
profile_mandatory_fields = frappe.get_hooks("profile_mandatory_fields")
for field in profile_form.web_form_fields:
field.reqd = 0
if field.fieldname in profile_mandatory_fields:
print(field.fieldname)
field.reqd = 1
profile_form.save()
def quiz_renderer(quiz_name):
quiz = frappe.get_doc("LMS Quiz", quiz_name)
context = dict(quiz=quiz)