From c18b2642d3e7f5e7805ee518198617e2209d7502 Mon Sep 17 00:00:00 2001 From: adinhodovic Date: Tue, 20 Feb 2024 15:00:53 +0100 Subject: [PATCH] fix: simplify --- django_wtf/customadmin/apps.py | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/django_wtf/customadmin/apps.py b/django_wtf/customadmin/apps.py index f47e06a..bc7ca4b 100644 --- a/django_wtf/customadmin/apps.py +++ b/django_wtf/customadmin/apps.py @@ -3,38 +3,11 @@ from django.contrib.admin.apps import AdminConfig from django.urls import path from django_web_repl.views import TerminalView +from django_web_repl_custom_admin.admin import CustomAdminSite -class CustomAdminSite(AdminSiteSearchView, admin.AdminSite): - def get_urls(self): - - urls = super().get_urls() - urls.insert( - 0, - path( - "terminal/", - self.admin_view(TerminalView.as_view()), - name="terminal", - ), - ) - return urls - - def get_app_list(self, request, app_label=None): - app_list = [ - { - "name": "Terminal", - "app_label": "terminal", - "models": [ - { - "name": "Terminal", - "object_name": "Terminal", - "admin_url": "/admin/terminal/", - "view_only": True, - } - ], - } - ] + super().get_app_list(request) - return app_list +class CustomAdminSite(AdminSiteSearchView, CustomAdminSite): + pass class CustomAdminConfig(AdminConfig):