diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-09-03 18:56:12 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-09-03 18:56:12 +0000 |
| commit | bdd13a4daaf2471c851f538a76e86010a968d24d (patch) | |
| tree | c83a7ccaecd9197b753159cc1ee500ef278c0af5 | |
| parent | e8cff0b8f3920419b1031e16e2ee01851bd75e1d (diff) | |
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
| -rw-r--r-- | django/contrib/auth/forms.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index 086acf3349..992a0ff44d 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -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 |
