diff --git a/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.py b/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.py index a1c30cbe..dcb7f71d 100644 --- a/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.py +++ b/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.py @@ -72,9 +72,12 @@ class LMSAssignmentSubmission(Document): ) def validate_status(self): - doc_before_save = self.get_doc_before_save() - if doc_before_save.status != self.status or doc_before_save.comments != self.comments: - self.trigger_update_notification() + if not self.is_new(): + doc_before_save = self.get_doc_before_save() + if ( + doc_before_save.status != self.status or doc_before_save.comments != self.comments + ): + self.trigger_update_notification() def trigger_update_notification(self): notification = frappe._dict(