[Django] #23497: Admin System Checks do not run for custom AdminSite sites

10 views
Skip to first unread message

Django

unread,
Sep 16, 2014, 3:21:13 PM9/16/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
--------------------------------------+--------------------
Reporter: amosson | Owner: nobody
Type: Bug | Status: new
Component: Core (System checks) | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
The admin section of the System checks only runs for ModelAdmin subclasses
that are registered with the main AdminSite (admin.site.register(...))

To replicate place something similar to the following in a urls.py file


{{{
books/admin.py
from django.contrib import admin

class BookAdmin(admin.ModelAdmin):
list_display = 'a field' # intentional error

- urls.py
from django.admin.sites import AdminSite
from books.models import Book
from books.admin import BookAdmin

custom_site = AdminSite()
custom_site.register(Book, BookAdmin)

> python manage.py check
Expect to see an error here (specifically that list display must be a list
of a tuple)
}}}

In actuality, this runs fine.

One potential fix for this problem would be to create a module level
variable in django.contrib.admin.sites (or directly in
django.contrib.admin), run the checks on register (this is already being
done but the result of the checks are being ignored), and store the
results in the module level variable.

Patch with this approach is attached

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

Django

unread,
Sep 16, 2014, 3:26:56 PM9/16/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
-------------------------------------+-------------------------------------

Reporter: amosson | Owner: nobody
Type: Bug | Status: new
Component: Core (System | Version: 1.7
checks) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by amosson):

* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


Comment:

Patch at https://github.com/amosson/django/tree/ticket_23497

--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:1>

Django

unread,
Sep 16, 2014, 3:35:02 PM9/16/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
-------------------------------------+-------------------------------------

Reporter: amosson | Owner: nobody
Type: Bug | Status: new
Component: Core (System | Version: 1.7
checks) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by charettes):

Could you submit a PR against Django's master instead? It makes reviewing
easier.

--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:2>

Django

unread,
Sep 16, 2014, 3:50:16 PM9/16/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
-------------------------------------+-------------------------------------

Reporter: amosson | Owner: nobody
Type: Bug | Status: new
Component: Core (System | Version: 1.7
checks) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by amosson):

Sure. Here you go

https://github.com/django/django/pull/3227

--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:3>

Django

unread,
Sep 23, 2014, 8:14:19 AM9/23/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
--------------------------------------+------------------------------------

Reporter: amosson | Owner: nobody
Type: Bug | Status: new
Component: Core (System checks) | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:4>

Django

unread,
Oct 7, 2014, 7:36:26 PM10/7/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
--------------------------------------+------------------------------------
Reporter: amosson | Owner: amosson
Type: Bug | Status: assigned

Component: Core (System checks) | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by amosson):

* owner: nobody => amosson
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:5>

Django

unread,
Dec 13, 2014, 10:31:56 PM12/13/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
--------------------------------------+------------------------------------
Reporter: amosson | Owner: amosson
Type: Bug | Status: assigned
Component: Core (System checks) | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by berkerpeksag):

I've opened [https://github.com/django/django/pull/3728 PR #3728] to
revise [https://github.com/django/django/pull/3227 PR #3227].

Changes:

* Fixed merge conflicts
* Added a release note
* Rewrote tests
* Updated commit message as suggested by Tim

--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:6>

Django

unread,
Dec 17, 2014, 9:13:09 AM12/17/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
--------------------------------------+------------------------------------
Reporter: amosson | Owner: amosson
Type: Bug | Status: closed

Component: Core (System checks) | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b7219c7ba5fdfbf9349948b5a91af50e32822ee6"]:
{{{
#!CommitTicketReference repository=""
revision="b7219c7ba5fdfbf9349948b5a91af50e32822ee6"
Fixed #23497 -- Made admin system checks run for custom AdminSites.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:7>

Django

unread,
Dec 17, 2014, 9:18:54 AM12/17/14
to django-...@googlegroups.com
#23497: Admin System Checks do not run for custom AdminSite sites
--------------------------------------+------------------------------------
Reporter: amosson | Owner: amosson
Type: Bug | Status: closed
Component: Core (System checks) | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"6d8c14621e2878ea2051ee56326c66969a1d18d0"]:
{{{
#!CommitTicketReference repository=""
revision="6d8c14621e2878ea2051ee56326c66969a1d18d0"
[1.7x.] Fixed #23497 -- Made admin system checks run for custom
AdminSites.

Backport of b7219c7ba5fdfbf9349948b5a91af50e32822ee6 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23497#comment:8>

Reply all
Reply to author
Forward
0 new messages