Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#33889 closed Bug (invalid)

Error in admin.site.register on pypy3.8 and Django 4.1+.

Reported by: Hasan Ramezani Owned by: nobody
Component: contrib.admin Version: 4.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I tried to include Django 4.1 in django-axes. then I noticed the CI fails on Django 4.1 and 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 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.

Change History (3)

comment:1 by Mariusz Felisiak, 2 years ago

Resolution: needsinfo
Status: newclosed
Summary: Error in admin.site.register on pypy3.8 Django 4.1 and mainError in admin.site.register on pypy3.8 and Django 4.1+.
Version: dev4.1

Thanks for this ticket, however this can be an issue in PyPy, not in Django itself. Can you debug this issue and provide details about why and where Django is at fault? I'd start from creating a bug report in PyPy and reopen this ticket if they indicate that Django is at fault.

comment:2 by Hasan Ramezani, 2 years ago

Ah sorry for the duplication.
Seems there is a related issue in PyPy and also you discussed about it in https://code.djangoproject.com/ticket/28358#comment:13

comment:3 by Mariusz Felisiak, 2 years ago

Resolution: needsinfoinvalid

I missed my own comments 🤦

Note: See TracTickets for help on using tickets.
Back to Top