﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33889	Error in admin.site.register on pypy3.8 and Django 4.1+.	Hasan Ramezani	nobody	"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."	Bug	closed	contrib.admin	4.1	Normal	invalid			Unreviewed	0	0	0	0	0	0
