Skip to content

Commit

Permalink
Fixed #14090 - Many sql queries needed to display change user form
Browse files Browse the repository at this point in the history
  
Thanks to Suor for report and patch.

Backport for [13683] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed Sep 3, 2010
1 parent 94047d7 commit 4b4168b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django/contrib/auth/forms.py
Expand Up @@ -52,6 +52,10 @@ class UserChangeForm(forms.ModelForm):
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
Expand Down

0 comments on commit 4b4168b

Please sign in to comment.