]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
settings: 'XViewMiddleware' is moved in Django 1.6 too
authorStephen Finucane <stephen@that.guru>
Thu, 18 May 2017 20:35:58 +0000 (21:35 +0100)
committerStephen Finucane <stephen@that.guru>
Thu, 18 May 2017 20:35:58 +0000 (21:35 +0100)
This was causing a deprecation warning. Clearly we don't need to special
case Django 1.6 here.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 9db5cd0 ("tox: Turn deprecation notices into warnings")
patchwork/settings/base.py

index fb6a76574c4942a78e58842f240daee0ab8cedf7..26c75c957b13fe408a4a0505e7e06c4a933ec0a3 100644 (file)
@@ -31,6 +31,7 @@ _MIDDLEWARE_CLASSES = [
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
+    'django.contrib.admindocs.middleware.XViewMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
 ]
@@ -40,12 +41,6 @@ if django.VERSION >= (1, 7):
         'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
     ]
 
-if django.VERSION >= (1, 7):
-    _MIDDLEWARE_CLASSES += [
-        'django.contrib.admindocs.middleware.XViewMiddleware'
-    ]
-else:
-    _MIDDLEWARE_CLASSES += ['django.middleware.doc.XViewMiddleware']
 
 if django.VERSION >= (1, 10):
     MIDDLEWARE = _MIDDLEWARE_CLASSES