feat: limit questions in quiz

This commit is contained in:
Jannat Patel
2024-06-28 12:21:07 +05:30
parent 0cd50ff1b6
commit 764f358708
8 changed files with 36 additions and 71 deletions

View File

@@ -15,7 +15,6 @@ class CustomUser(User):
def validate(self):
super().validate()
self.validate_username_duplicates()
self.validate_completion()
def validate_username_duplicates(self):
while not self.username or self.username_exists():
@@ -38,19 +37,6 @@ class CustomUser(User):
else:
frappe.throw(_("Skills must be unique"))
def validate_completion(self):
if frappe.db.get_single_value("LMS Settings", "force_profile_completion"):
all_fields_have_value = True
profile_mandatory_fields = frappe.get_hooks("profile_mandatory_fields")
docfields = frappe.get_meta(self.doctype).fields
for field in profile_mandatory_fields:
if not self.get(field):
all_fields_have_value = False
break
self.profile_complete = all_fields_have_value
def get_batch_count(self) -> int:
"""Returns the number of batches authored by this user."""
return frappe.db.count(