Commit 80055771 authored by erdnaxe's avatar erdnaxe 🎇

Admin for non staff

parent aca1d2de
Pipeline #1407 failed with stage
in 3 minutes and 9 seconds
......@@ -3,6 +3,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.admin import AdminSite
from django.contrib.auth.admin import Group, GroupAdmin
from django.contrib.sites.admin import Site, SiteAdmin
from django.utils.translation import gettext_lazy as _
from django.views.decorators.cache import never_cache
......@@ -25,5 +27,14 @@ class DatabaseAdmin(AdminSite):
return response
def has_permission(self, request):
"""
Authorize all active user to access admin
"""
return request.user.is_active
# Instantiate admin site and register some defaults
admin_site = DatabaseAdmin()
admin_site.register(Group, GroupAdmin)
admin_site.register(Site, SiteAdmin)
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