excludee null fields in _construct_relations (#870)

* excludee null fields in _construct_relations

* add missing test to check empty relation in construct

Co-authored-by: collerek <collerek@gmail.com>
This commit is contained in:
Abdeldjalil-H
2022-10-11 15:55:08 +01:00
committed by GitHub
parent 3661967a27
commit 2c1768bb61
2 changed files with 11 additions and 0 deletions

View File

@ -859,6 +859,7 @@ class NewBaseModel(pydantic.BaseModel, ModelTableProxy, metaclass=ModelMetaclass
relation_value = [
relation_field.expand_relationship(x, model, to_register=False)
for x in value_to_set
if x is not None
]
for child in relation_value: