Opened 4 years ago

Closed 4 years ago

#31353 closed Cleanup/optimization (wontfix)

Improved performance of admin changeform_view.

Reported by: Hasan Ramezani Owned by: Hasan Ramezani
Component: contrib.admin Version: 3.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

There is a check for formset and form validation in ModelAdmin._changeform_view

if all_valid(formsets) and form_validated:

We can change the order of checks to prevent validation of all formsets when form_validated=Flase:

if form_validated and all_valid(formsets):

Here is the PR.

Change History (3)

comment:1 by Hasan Ramezani, 4 years ago

Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:2 by Simon Charette, 4 years ago

I suspect things are done this way for a reason, swapping the order around won't call is_valid on each inline formsets and prevent validation errors from showing up unless the form is valid.

comment:3 by Mariusz Felisiak, 4 years ago

Resolution: wontfix
Status: assignedclosed

Thanks for this ticket, however I agree with Simon, we can omit formsets validation if we swap this conditions.

Note: See TracTickets for help on using tickets.
Back to Top