Skip to content

Commit bdd13a4

Browse files
committed
Fixed #14090 - Many sql queries needed to display change user form
Thanks to Suor for report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13683 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent e8cff0b commit bdd13a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

django/contrib/auth/forms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class UserChangeForm(forms.ModelForm):
5252
class Meta:
5353
model = User
5454

55+
def __init__(self, *args, **kwargs):
56+
super(UserChangeForm, self).__init__(*args, **kwargs)
57+
self.fields['user_permissions'].queryset = self.fields['user_permissions'].queryset.select_related('content_type')
58+
5559
class AuthenticationForm(forms.Form):
5660
"""
5761
Base class for authenticating users. Extend this to get a form that accepts

0 commit comments

Comments
 (0)