[Django] #33889: Error in admin.site.register on pypy3.8 Django 4.1 and main

130 views
Skip to first unread message

Django

unread,
Aug 3, 2022, 11:43:02 AM8/3/22
to django-...@googlegroups.com
#33889: Error in admin.site.register on pypy3.8 Django 4.1 and main
------------------------------------------+------------------------
Reporter: Hasan Ramezani | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
I tried to [https://github.com/jazzband/django-axes/pull/910 include
Django 4.1 in django-axes]. then I noticed the CI fails on
[https://github.com/jazzband/django-
axes/runs/7653550763?check_suite_focus=true Django 4.1] and
[https://github.com/jazzband/django-
axes/runs/7653551446?check_suite_focus=true Django main] with the
following error:


{{{
File "/home/runner/work/django-axes/django-
axes/.tox/pypy38-djmain/lib/pypy3.8/site-
packages/django/contrib/auth/admin.py", line 29, in <module>
class GroupAdmin(admin.ModelAdmin):
File "/home/runner/work/django-axes/django-
axes/.tox/pypy38-djmain/lib/pypy3.8/site-
packages/django/contrib/admin/decorators.py", line 102, in
_model_admin_wrapper
raise ValueError("site must subclass AdminSite")
ValueError: site must subclass AdminSite
}}}

It seems the error comes from
[https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/django/contrib/admin/decorators.py#L101
register decorator]

I've checked it and found this introduced after
https://github.com/django/django/commit/97d7990abde3fe4b525ae83958fd0b52d6a1d13f

It seems the `if not isinstance(admin_site, AdminSite):` returns `False`
after this change.

--
Ticket URL: <https://code.djangoproject.com/ticket/33889>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages