diff --git a/model_bakery/recipe.py b/model_bakery/recipe.py index b302f96c..c1df72b8 100644 --- a/model_bakery/recipe.py +++ b/model_bakery/recipe.py @@ -52,7 +52,7 @@ def _mapping( # noqa: C901 m = finder.get_model(self._model) else: m = self._model - if k not in self._iterator_backups or m.objects.count() == 0: + if k not in self._iterator_backups or not m.objects.exists(): self._iterator_backups[k] = itertools.tee( self._iterator_backups.get(k, [v])[0] )