[Django] #35561: Model.save()/asave() deprecation allows duplicate arguments

13 views
Skip to first unread message

Django

unread,
Jun 25, 2024, 10:23:17 AM (4 days ago) Jun 25
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam | Owner: nobody
Johnson |
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 5.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Follow-up to #35554.

The deprecation code from #35060 allows duplicate arguments between the
positional and keyword variants. For example, `Model.save(True,
force_insert=False)` tries to set `force_insert` to `True` positionally
and `False` by keyword.

This should be detected and raised as a `TypeError`, like Python would
normally do.
--
Ticket URL: <https://code.djangoproject.com/ticket/35561>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 25, 2024, 3:04:00 PM (4 days ago) Jun 25
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Natalia
| Bidart
Type: Bug | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* has_patch: 0 => 1
* owner: nobody => Natalia Bidart
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
* status: new => assigned
* type: Cleanup/optimization => Bug

--
Ticket URL: <https://code.djangoproject.com/ticket/35561#comment:1>

Django

unread,
Jun 25, 2024, 3:09:01 PM (4 days ago) Jun 25
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Natalia
| Bidart
Type: Bug | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* cc: Adam Johnson (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/35561#comment:2>

Django

unread,
Jun 26, 2024, 11:12:57 AM (3 days ago) Jun 26
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Natalia
| Bidart
Type: Bug | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35561#comment:3>

Django

unread,
Jun 26, 2024, 11:15:09 AM (3 days ago) Jun 26
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Natalia
| Bidart
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia <124304+nessita@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"432b069b5f194d821c12208c65e88856ac52cc28" 432b069b]:
{{{#!CommitTicketReference repository=""
revision="432b069b5f194d821c12208c65e88856ac52cc28"
[5.1.x] Fixed #35561 -- Made *args and **kwargs parsing more strict in
Model.save()/asave().

Backport of e56a32b89bb7fadffdfaa2cdf12b4863ccd5af9b from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35561#comment:4>

Django

unread,
Jun 26, 2024, 11:16:48 AM (3 days ago) Jun 26
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Natalia
| Bidart
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

Fixed in `main` in e56a32b89bb7fadffdfaa2cdf12b4863ccd5af9b.
--
Ticket URL: <https://code.djangoproject.com/ticket/35561#comment:5>

Django

unread,
Jun 28, 2024, 9:25:16 AM (yesterday) Jun 28
to django-...@googlegroups.com
#35561: Model.save()/asave() deprecation allows duplicate arguments
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Natalia
| Bidart
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by GitHub <noreply@…>):

In [changeset:"a5215f9a3e9b8422678289c259e826f97e4dc63a" a5215f9a]:
{{{#!CommitTicketReference repository=""
revision="a5215f9a3e9b8422678289c259e826f97e4dc63a"
Refs #35561 -- Renamed Model.save()/asave() helper to a more specific
name.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35561#comment:6>
Reply all
Reply to author
Forward
0 new messages