Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Recipe prepare #512

Merged
merged 1 commit into from
Jan 5, 2025
Merged

fix: Recipe prepare #512

merged 1 commit into from
Jan 5, 2025

Conversation

MaHryCT3
Copy link
Contributor

Describe the change
Fixed the error that when using Recipe.prepare the _quantity parameter was None

Error stack trace

tests/test_baker.py:292: in test_recipe_prepare_model_with_one_to_one_and_save_related
    lonely_person = baker_recipes.lonely_person.prepare(_save_related=True)
model_bakery/recipe.py:175: in prepare
    self._model, _using=_using, **self._mapping(_using, defaults)
model_bakery/recipe.py:72: in _mapping
    for _ in range(_quantity)
E   TypeError: 'NoneType' object cannot be interpreted as an integer

PR Checklist

  • Change is covered with tests
  • CHANGELOG.md is updated if needed

Copy link
Collaborator

@amureki amureki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix, @MaHryCT3 !

@amureki amureki merged commit 2a3564f into model-bakers:main Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants