fix: eval request duplicate conditions
This commit is contained in:
@@ -21,7 +21,8 @@ class LMSCertificateRequest(Document):
|
||||
)
|
||||
|
||||
for req in existing_requests:
|
||||
if req.date == getdate(self.date) or getdate() <= getdate(self.date):
|
||||
print(req.date, getdate(self.date), getdate())
|
||||
if req.date == getdate(self.date) or getdate() <= getdate(req.date):
|
||||
course_title = frappe.db.get_value("LMS Course", req.course, "title")
|
||||
frappe.throw(
|
||||
_("You already have an evaluation on {0} at {1} for the course {2}.").format(
|
||||
|
||||
@@ -107,7 +107,6 @@ const submit_evaluation_form = (values) => {
|
||||
frappe.throw(__("Please select a slot"));
|
||||
}
|
||||
|
||||
this.eval_form.hide();
|
||||
frappe.call({
|
||||
method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.create_certificate_request",
|
||||
args: {
|
||||
@@ -119,6 +118,7 @@ const submit_evaluation_form = (values) => {
|
||||
class_name: class_name,
|
||||
},
|
||||
callback: (r) => {
|
||||
this.eval_form.hide();
|
||||
frappe.show_alert({
|
||||
message: __("Evaluation scheduled successfully"),
|
||||
indicator: "green",
|
||||
|
||||
Reference in New Issue
Block a user