From: Stephen Finucane Date: Thu, 18 May 2017 20:35:58 +0000 (+0100) Subject: settings: 'XViewMiddleware' is moved in Django 1.6 too X-Git-Tag: v2.0.0-rc2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=124fcf4c5e464dd6aaadd155bcf0b8d28e4fe381;p=thirdparty%2Fpatchwork.git settings: 'XViewMiddleware' is moved in Django 1.6 too This was causing a deprecation warning. Clearly we don't need to special case Django 1.6 here. Signed-off-by: Stephen Finucane Fixes: 9db5cd0 ("tox: Turn deprecation notices into warnings") --- diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index fb6a7657..26c75c95 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -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