#35554: Model.save() positional argument parsing slightly incorrect
-------------------------------------+-------------------------------------
               Reporter:  Adam       |          Owner:  Adam Johnson
  Johnson                            |
                   Type:  Bug        |         Status:  assigned
              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          |
-------------------------------------+-------------------------------------
 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:

 1. Calling with extra positional arguments, such as `Model.save(False,
 False, None, None, None)`, no longer raises a `TypeError`.
 2. 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.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35554>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701904a4128b5-0c40c87d-eda4-4dcb-ab13-031114cce3d7-000000%40eu-central-1.amazonses.com.

Reply via email to