Ticket #25895: 25895.diff

File 25895.diff, 2.6 KB (added by Tim Graham, 7 years ago)
  • docs/releases/1.10.txt

    diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt
    index 64fb792..4271848 100644
    a b when creating a user or changing usernames:: 
    323323If you wish to keep this restriction in the admin, set ``UserAdmin.add_form``
    324324to use this form::
    325325
    326     from django.contrib.auth.admin import UserAdmin
     326    from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
    327327    from django.contrib.auth.models import User
    328328
    329     class MyUserAdmin(UserAdmin):
     329    class MyUserAdmin(BaseUserAdmin):
    330330        add_form = MyUserCreationForm
    331331
    332332    admin.site.unregister(User)
  • docs/topics/auth/customizing.txt

    diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt
    index 837bbf8..3da3cc6 100644
    a b add it to a ``UserAdmin`` class which is registered with the 
    326326:class:`~django.contrib.auth.models.User` class::
    327327
    328328    from django.contrib import admin
    329     from django.contrib.auth.admin import UserAdmin
     329    from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
    330330    from django.contrib.auth.models import User
    331331
    332332    from my_user_profile_app.models import Employee
    add it to a ``UserAdmin`` class which is registered with the 
    339339        verbose_name_plural = 'employee'
    340340
    341341    # Define a new User admin
    342     class UserAdmin(UserAdmin):
     342    class UserAdmin(BaseUserAdmin):
    343343        inlines = (EmployeeInline, )
    344344
    345345    # Re-register UserAdmin
    code would be required in the app's ``admin.py`` file:: 
    10591059    from django import forms
    10601060    from django.contrib import admin
    10611061    from django.contrib.auth.models import Group
    1062     from django.contrib.auth.admin import UserAdmin
     1062    from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
    10631063    from django.contrib.auth.forms import ReadOnlyPasswordHashField
    10641064
    10651065    from customauth.models import MyUser
    code would be required in the app's ``admin.py`` file:: 
    11101110            return self.initial["password"]
    11111111
    11121112
    1113     class MyUserAdmin(UserAdmin):
     1113    class UserAdmin(BaseUserAdmin):
    11141114        # The forms to add and change user instances
    11151115        form = UserChangeForm
    11161116        add_form = UserCreationForm
    code would be required in the app's ``admin.py`` file:: 
    11381138        filter_horizontal = ()
    11391139
    11401140    # Now register the new UserAdmin...
    1141     admin.site.register(MyUser, MyUserAdmin)
     1141    admin.site.register(MyUser, UserAdmin)
    11421142    # ... and, since we're not using Django's built-in permissions,
    11431143    # unregister the Group model from admin.
    11441144    admin.site.unregister(Group)
Back to Top