Ticket #14090: auth.permissions.select_related.content_type.diff

File auth.permissions.select_related.content_type.diff, 620 bytes (added by Alexander Schepanovski, 14 years ago)
  • django/contrib/auth/forms.py

     
    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
    5559class AuthenticationForm(forms.Form):
    5660    """
    5761    Base class for authenticating users. Extend this to get a form that accepts
Back to Top