#31616: Change order of admin.checks.check_dependencies so that admin.E410 comes
before admin.E408
------------------------------------------------+------------------------
               Reporter:  Keryn Knight          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  contrib.admin         |        Version:  3.0
               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                     |
------------------------------------------------+------------------------
 Given an empty `MIDDLEWARE` in your project, you try and run the admin.
 The system checks framework kicks in, giving you:
 {{{
 (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware'
 must be in MIDDLEWARE in order to use the admin application.
 (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware' must
 be in MIDDLEWARE in order to use the admin application.
 (admin.E410) 'django.contrib.sessions.middleware.SessionMiddleware' must
 be in MIDDLEWARE in order to use the admin application.
 }}}

 You add each of those middlewares to the stack, and run the application:

 {{{
 File "/path/to/django/contrib/auth/middleware.py", line 23, in
 process_request
     ) % ("_CLASSES" if settings.MIDDLEWARE is None else "")
 AssertionError: The Django authentication middleware requires session
 middleware to be installed. Edit your MIDDLEWARE setting to insert
 'django.contrib.sessions.middleware.SessionMiddleware' before
 'django.contrib.auth.middleware.AuthenticationMiddleware'
 }}}

 Ignoring the fact that it ''should'' be a system check, and it's an
 unfortunate side-effect of spanning 2 separate contrib apps that it isn't,
 if the order of the errors output was updated, we'd not see this exception
 in this specific scenario.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31616>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.03f42d5a494ddbe219295557c8503528%40djangoproject.com.

Reply via email to