lekjos / django-custom-admin-pages Goto Github PK
View Code? Open in Web Editor NEWA Django app that allows you to register class-based views to appear in Django admin.
License: BSD 3-Clause "New" or "Revised" License
A Django app that allows you to register class-based views to appear in Django admin.
License: BSD 3-Clause "New" or "Revised" License
Describe the bug
Django recommends that for local apps, you specify the INSTALLED_APPS
via the dotted path to the AppConfig
(see INSTALLED_APPS).
In order to pass the check added by 1.2.2, the app_label needs to be the same string used INSTALLED_APPS
. However, if this is used, then we can no longer match on app_label CustomAdminSite
's get_app_list()
.
To Reproduce
Steps to reproduce the behavior:
my_app.apps.MyAppConfig
.Expected behavior
Correct app is identified.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
I believe we would expect found
to be set to True in this scenario (ref)
for app in app_list:
if view_app_label == app.get("app_label", "").lower():
found = True
But since it falls through, another issue occurs on line 210 because get_installed_apps()
returns a flat list of strings, whereas app_list
is a list of dicts containing 'name', 'app_label', etc.
This causes the following TypeError:
File "<path>/.venv/lib/python3.11/site-packages/django_custom_admin_pages/admin.py", line 210, in get_app_list
remaining_apps = set(set(get_installed_apps())).difference(app_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unhashable type: 'dict'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.