Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#14090 closed (fixed)

Many sql queries needed to display change user form

Reported by: Suor Owned by: Suor
Component: contrib.auth Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Permission.__unicode__ refers to content_type, so while rendering options for user_permissions field a sql query is executed to fetch every content_type for every permission.

Attachments (1)

auth.permissions.select_related.content_type.diff (620 bytes) - added by Suor 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by Suor

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to Suor
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 5 years ago by kmtracey

  • Triage Stage changed from Unreviewed to Accepted

This is #13690 with a proposed fix, thanks. In a quick test on a random project the suggested change reduces the number of SQL queries for bringing up a change user page from 109 to 8.

comment:3 Changed 5 years ago by Suor

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 5 years ago by lukeplant

A fix for #14195 might also fix this.

comment:5 Changed 4 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [13683]) Fixed #14090 - Many sql queries needed to display change user form

Thanks to Suor for report and patch.

comment:6 Changed 4 years ago by lukeplant

(In [13684]) Fixed #14090 - Many sql queries needed to display change user form

Thanks to Suor for report and patch.

Backport for [13683] from trunk.

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