fix: add fallback when getting children in as_dict

This commit is contained in:
Sagar Vora 2025-10-13 11:48:03 +05:30
parent 7307d99227
commit ae21d544a5

View file

@ -655,7 +655,7 @@ class BaseDocument:
self._non_virtual_table_fieldnames if ignore_virtual_child_tables else self._table_fieldnames
)
for fieldname in table_fieldnames:
children = getattr(self, fieldname) or []
children = getattr(self, fieldname, None) or []
doc[fieldname] = [
d.as_dict(
convert_dates_to_str=convert_dates_to_str,