Model.save() positional argument parsing slightly incorrect
Ticket #35060 introduced a deprecation pathway for positional arguments in Model.save(). The code introduced to match positional arguments is slightly incorrect, leading to some subtle behaviour changes:
- Calling with extra positional arguments, such as
Model.save(False, False, None, None, None), no longer raises a TypeError.
- Calling with positional empty
update_fields, such as Model.save(False, False, None, []), would try to save all fields, due to truthy-checking of arguments.
These are definitely edge cases, but we can easily avoid them with alternative parsing logic. PR incoming.
Change History
(6)
| Severity: |
Normal → Release blocker
|
| Triage Stage: |
Unreviewed → Accepted
|
| Needs tests: |
set
|
| Patch needs improvement: |
set
|
| Needs tests: |
unset
|
| Patch needs improvement: |
unset
|
| Triage Stage: |
Accepted → Ready for checkin
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
PR