#26961: Admin check does not run unless DEBUG = True
-------------------------------+--------------------
Reporter: adamchainz | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.9
Severity: Normal | Keywords: checks
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
In our CI system we run `call_command('check')` during tests and
`manage.py check` before deployment. Two bugs crept through recently
thanks to broken admin checks.
This is because the contrib.admin checks don't run unless `DEBUG = True`,
which is not recommended for tests or production, so we never saw these
checks break.
The commit that moved the checks from custom validation to the check
framework hints at why this it was historically only when `DEBUG = True`
at
https://github.com/django/django/commit/4ad1eb1c14b629cf5bcfd253ed40e875f1bddd47
#diff-57866af2aff590165ffe4967107424fdL69 :
> Don't import the humongous validation code unless required
This isn't valid reason with the check framework since all the code is
imported anyway when assigning `checks_class` on `BaseModelAdmin`, the
only memory now saved is that the list of failing checks isn't
instantiated.
I'd argue the `DEBUG` requirement should be removed
--
Ticket URL: <https://code.djangoproject.com/ticket/26961>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.9a26168433c8eba87c87fcd239fa5227%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.