Commit 00de244a authored by fred's avatar fred

fix user admin to inherit from classic user admin

parent 112e3f2a
from django.contrib import admin
import django.contrib.auth.admin
from django.utils.translation import ugettext, ugettext_lazy as _
from .models import User
from .forms import UserChangeForm
class UserAdmin(django.contrib.auth.admin.UserAdmin):
form = UserChangeForm
fieldsets = (
(None, {'fields': ('username', 'password')}),
(_('Personal info'), {'fields': ('first_name', 'last_name', 'email',
'emissions', 'news_categories')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
'groups', 'user_permissions')}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
class UserAdmin(admin.ModelAdmin):
pass
admin.site.register(User, UserAdmin)
import django.contrib.auth.forms
from .models import User
class UserChangeForm(django.contrib.auth.forms.UserChangeForm):
class Meta:
model = User
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment