Skip to content

Commit

Permalink
fix: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
adinhodovic committed Feb 20, 2024
1 parent 03e6b2e commit c18b264
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions django_wtf/customadmin/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c18b264

Please sign in to comment.