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,8 +72,11 @@ class LMSAssignmentSubmission(Document):
) )
def validate_status(self): def validate_status(self):
if not self.is_new():
doc_before_save = self.get_doc_before_save() doc_before_save = self.get_doc_before_save()
if doc_before_save.status != self.status or doc_before_save.comments != self.comments: if (
doc_before_save.status != self.status or doc_before_save.comments != self.comments
):
self.trigger_update_notification() self.trigger_update_notification()
def trigger_update_notification(self): def trigger_update_notification(self):