8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-24 20:33:11 +00:00
re2o/useradmin/admin.py

17 lines
414 B
Python
Raw Normal View History

2019-03-01 09:18:42 +00:00
from django.contrib import admin
2019-02-16 08:53:42 +00:00
2019-03-01 09:18:42 +00:00
class UserAdmin(admin.sites.AdminSite):
2019-02-16 08:53:42 +00:00
def has_permission(self, request):
"""This admin site doesn't require being staff"""
return request.user.is_active
2019-03-01 09:18:42 +00:00
class ModelUserAdmin(admin.ModelAdmin):
# Display actions on changelist bottom bu default
actions_on_bottom = True
# Defines new management site
2019-02-16 08:53:42 +00:00
user_admin_site = UserAdmin(name='user_admin')