mybuddy/babybuddy/admin.py

31 lines
761 B
Python
Raw Normal View History

2017-11-11 22:27:42 +00:00
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
2017-11-11 22:27:42 +00:00
from babybuddy import models
class SettingsInline(admin.StackedInline):
model = models.Settings
verbose_name = _('Settings')
verbose_name_plural = _('Settings')
2017-11-11 22:27:42 +00:00
can_delete = False
fieldsets = (
(_('Dashboard'), {
'fields': (
'dashboard_refresh_rate',
'dashboard_hide_empty',
'dashboard_hide_age')
2017-11-11 22:27:42 +00:00
}),
)
class UserAdmin(BaseUserAdmin):
inlines = (SettingsInline, )
admin.site.unregister(User)
admin.site.register(User, UserAdmin)