Fix wrongly excluding relations if they were not in proper order and one of them were excluded. Fix for #779 (#890)

This commit is contained in:
collerek
2022-10-21 14:38:16 +02:00
committed by GitHub
parent 4fa0205598
commit f1c0ee336b
3 changed files with 93 additions and 2 deletions

View File

@ -306,7 +306,7 @@ class Model(ModelRow):
Allow to refresh existing Models fields from database.
Performs refresh of the related models fields.
By default loads only self and the directly related ones.
By default, loads only self and the directly related ones.
If follow=True is set it loads also related models of related models.

View File

@ -193,7 +193,7 @@ class ModelRow(NewBaseModel):
model_cls=cast(Type["Model"], cls), alias=table_prefix
)
if model_excludable.is_excluded(related):
return item
continue
relation_str, remainder = cls._process_remainder_and_relation_string(
related_models=related_models,