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

Support multi-level nested create/update with model full_clean() #659

Prev Previous commit
Next Next commit
Remove unecessary @transaction.atomic() call
philipstarkey committed Dec 10, 2024
commit b73c0fbe57100af5d5ba255a1f448a769fe4f15b
1 change: 0 additions & 1 deletion strawberry_django/mutations/resolvers.py
Original file line number Diff line number Diff line change
@@ -334,7 +334,6 @@
) -> list[_M]: ...


@transaction.atomic
def create(
info: Info,
model: type[_M],
@@ -414,7 +413,7 @@
# full-clean() to trigger form-validation style error messages.
full_clean_options = full_clean if isinstance(full_clean, dict) else {}
if full_clean:
dummy_instance.full_clean(**full_clean_options) # type: ignore

Check warning on line 416 in strawberry_django/mutations/resolvers.py

GitHub Actions / Typing

Unnecessary "# type: ignore" comment (reportUnnecessaryTypeIgnoreComment)

# Create the instance using the manager create method to respect
# manager create overrides. This also ensures support for proxy-models.