Merge pull request #33685 from AMR-Mannesmann/fix(document)-is_child_table_same-for-new-docs

fix(document): is_child_table_same for new docs
This commit is contained in:
Akhil Narang 2025-09-02 11:37:06 +05:30 committed by GitHub
commit 5b26db7265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -842,9 +842,13 @@ class Document(BaseDocument):
def is_child_table_same(self, fieldname):
"""Validate child table is same as original table before saving"""
if self.is_new():
return False
same = True
value = self.get(fieldname)
original_value = self._doc_before_save.get(fieldname)
same = True
if len(original_value) != len(value):
same = False