#35418: ValueError: site must subclass AdminSite
-------------------------------------+-------------------------------------
Reporter: Lily Foote | Owner: Ahmed
Type: | Nassar
Cleanup/optimization | Status: assigned
Component: Utilities | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Carsten Agger):
OK, I found a workaround which could hold during development:
{{{
--- a/django/contrib/admin/decorators.py
+++ b/django/contrib/admin/decorators.py
@@ -98,8 +98,8 @@ def register(*models, site=None):
admin_site = site or default_site
- if not isinstance(admin_site, AdminSite):
- raise ValueError("site must subclass AdminSite")
+ # if not isinstance(admin_site, AdminSite):
+ # raise ValueError("site must subclass AdminSite")
if not issubclass(admin_class, ModelAdmin):
raise ValueError("Wrapped class must subclass ModelAdmin.")
}}}
This at least makes tests pass. It remains to be seen if it actually works
in practice.
--
Ticket URL: <https://code.djangoproject.com/ticket/35418#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019ac55d9279-7024f87b-9de7-42e1-8a46-ae6cc986e45c-000000%40eu-central-1.amazonses.com.