Skip to content

Commit

Permalink
Merge pull request #704 from pateljannat/evaluation-fields
Browse files Browse the repository at this point in the history
fix: evaluation fields
  • Loading branch information
pateljannat authored Dec 19, 2023
2 parents d5118cc + 00b0a20 commit 7ae7722
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@
"fieldtype": "Rating",
"in_list_view": 1,
"label": "Rating",
"reqd": 1
"mandatory_depends_on": "eval:doc.status != 'Pending' && doc.status != 'In Progress'"
},
{
"fieldname": "summary",
"fieldtype": "Small Text",
"label": "Summary"
"label": "Summary",
"mandatory_depends_on": "eval:doc.status != 'Pending' && doc.status != 'In Progress'"
},
{
"fieldname": "date",
Expand Down Expand Up @@ -106,7 +107,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-09-26 19:44:43.594892",
"modified": "2023-12-18 20:03:27.040073",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Evaluation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
# For license information, please see license.txt

import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from lms.lms.utils import has_course_moderator_role


class LMSCertificateEvaluation(Document):
pass
def validate(self):
self.validate_rating()

def validate_rating(self):
if self.status not in ["Pending", "In Progress"] and self.rating == 0:
frappe.throw(_("Rating cannot be 0"))


def has_website_permission(doc, ptype, user, verbose=False):
Expand Down

0 comments on commit 7ae7722

Please sign in to comment.