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 SoftDeletableModel.delete() forwarding positional args to superclass #611

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

mthuurne
Copy link
Contributor

The soft argument was made keyword-only, to avoid conflicts with new positional arguments that might be added to Django. It was already conflicting with the keep_parents argument.

This is a backward incompatible change: code that used to pass soft positionally will require updating. Hopefully most code was either using the default (True) or was already passing soft=False as a keyword argument.

…class

The `soft` argument was made keyword-only, to avoid conflicts with new
positional arguments that might be added to Django. It was already
conflicting with the `keep_parents` argument.

The `using` argument is now passed to the superclass positionally,
as otherwise it can overlap with `*args`, resulting in a `TypeError`
on calls where `keep_parents` is passed positionally.
@mthuurne mthuurne mentioned this pull request Apr 11, 2024
@mthuurne
Copy link
Contributor Author

mthuurne commented Apr 11, 2024

Perhaps it would be safer to not forward any positional arguments to the superclass at all, and forward only keyword arguments. However, that would mean deviating from the interface that Django defines.

@foarsitter foarsitter merged commit 0693983 into jazzband:master Apr 17, 2024
7 checks passed
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