1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Refs #26601 -- Removed obsolete workarounds for MIDDLEWARE_CLASSES setting.

This commit is contained in:
Sergey Fedoseev
2019-10-22 16:01:14 +05:00
committed by Mariusz Felisiak
parent d4e767911f
commit 0315c18fe1
4 changed files with 6 additions and 10 deletions

View File

@@ -18,10 +18,8 @@ class XViewMiddleware(MiddlewareMixin):
"""
assert hasattr(request, 'user'), (
"The XView middleware requires authentication middleware to be "
"installed. Edit your MIDDLEWARE%s setting to insert "
"'django.contrib.auth.middleware.AuthenticationMiddleware'." % (
"_CLASSES" if settings.MIDDLEWARE is None else ""
)
"installed. Edit your MIDDLEWARE setting to insert "
"'django.contrib.auth.middleware.AuthenticationMiddleware'."
)
if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or
(request.user.is_active and request.user.is_staff)):