1. Luke Plant
  2. django


Luke Plant  committed 858d41b

Fixed #14090 - Many sql queries needed to display change user form

Thanks to Suor for report and patch.

Backport for [13683] from trunk.

  • Participants
  • Parent commits 5ec3424
  • Branches releases/1.2.X

Comments (0)

Files changed (1)

File django/contrib/auth/forms.py

View file
     class Meta:
         model = User
+    def __init__(self, *args, **kwargs):
+        super(UserChangeForm, self).__init__(*args, **kwargs)
+        self.fields['user_permissions'].queryset = self.fields['user_permissions'].queryset.select_related('content_type')
 class AuthenticationForm(forms.Form):
     Base class for authenticating users. Extend this to get a form that accepts