Added admin fields to user
This commit is contained in:
parent
1b8c461cc1
commit
f4dcb187ae
@ -14,8 +14,16 @@ class SubscriberInline(admin.StackedInline):
|
||||
|
||||
|
||||
class ExtendUserAdmin(admin.ModelAdmin):
|
||||
list_display = ['username', 'first_name', 'last_name', 'email', 'date_joined', 'newsletter', 'is_staff', 'is_superuser']
|
||||
search_fields = ['username', 'first_name', 'last_name', 'email']
|
||||
list_filter = ['is_staff', 'is_superuser']
|
||||
inlines = [SubscriberInline]
|
||||
|
||||
def newsletter(self, obj):
|
||||
print(vars(obj))
|
||||
return bool(True)
|
||||
newsletter.boolean = True
|
||||
|
||||
|
||||
admin.site.unregister(User)
|
||||
admin.site.register(User, ExtendUserAdmin)
|
||||
|
Loading…
Reference in New Issue
Block a user