#36801: `construct_change_message`call `form.changed_data` after check if is add
-------------------------------------+-------------------------------------
Reporter: Rodolfo Becerra | Owner: Rodolfo
Type: | Becerra
Cleanup/optimization | Status: closed
Component: contrib.admin | Version:
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
construct_change_message | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):
* resolution: => fixed
* status: new => closed
Comment:
In [changeset:"a77e541d1d8766b0e7d2c4143076ef07973f5bd9" a77e541]:
{{{#!CommitTicketReference repository=""
revision="a77e541d1d8766b0e7d2c4143076ef07973f5bd9"
Fixed #36801 -- Avoided unnecessary calculation in
construct_change_message().
`changed_field_labels` is only needed if there are changes to log, so move
its
calculation, including the somewhat costly `translation_override()`,
inside the
conditional that checks for changes. Also avoid reading
`form.changed_data`
when it’s already bound to `changed_data`.
co-authored-by: Rodolfo Becerra
<[email protected]>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36801#comment:5>
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 visit
https://groups.google.com/d/msgid/django-updates/0107019bc72b96a3-1f5e5678-1bc2-4bb3-bbb6-c3b731b2f039-000000%40eu-central-1.amazonses.com.