Closed bellini666 closed 4 months ago
This pull request addresses issue #599 by ensuring that FileFields are only cleared (set to False) when updating an existing instance and not during creation. A new test case was added to verify the correct behavior when an optional file field is not set during creation.
Files | Changes |
---|---|
tests/mutations/test_mutations.py strawberry_django/mutations/resolvers.py |
Added a test case to cover the scenario of not setting an optional file field during creation and updated the resolver logic to only clear FileFields when updating an existing instance. |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.73%. Comparing base (
6dc6be9
) to head (6499d95
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Fix #599
Summary by Sourcery
This pull request fixes a bug where FileField values were being incorrectly cleared during instance creation. It ensures that FileField values are only set to False to clear them when updating an existing instance. Additionally, a new test has been added to verify the correct handling of optional FileField values during creation.