fix: don't check assignment submission status if doc is new

This commit is contained in:
Jannat Patel
2025-01-17 14:24:14 +05:30
parent 4f0a6a7d57
commit 9dc8322270

View File

@@ -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(