]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Revert "Remove Django < 1.7 blocks"
authorStephen Finucane <stephen.finucane@intel.com>
Sat, 7 Nov 2015 01:20:05 +0000 (01:20 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Sat, 7 Nov 2015 01:20:05 +0000 (01:20 +0000)
This reverts commit ea050ad02c61ff1f0bd03ffb02b4706817401aee.

To allow patchwork deployment on Enterpise versions of Linux, it is
necessary to continue to support Django 1.6.

patchwork/settings/base.py
patchwork/settings/dev.py
patchwork/settings/production.example.py
patchwork/tests/browser.py

index 82c792c7ef14ce036a1646a62009b35ccf8318a6..ae9362234b508fdcf65550cd429082bb45adbc2e 100644 (file)
@@ -37,8 +37,11 @@ MIDDLEWARE_CLASSES = [
     'django.middleware.csrf.CsrfViewMiddleware',
 ]
 
-MIDDLEWARE_CLASSES.append(
-    'django.contrib.admindocs.middleware.XViewMiddleware')
+if django.VERSION < (1, 7):
+    MIDDLEWARE_CLASSES.append('django.middleware.doc.XViewMiddleware')
+else:
+    MIDDLEWARE_CLASSES.append(
+        'django.contrib.admindocs.middleware.XViewMiddleware')
 
 # Globalization
 
index 62dfe2ebbe9fe6ab6d57b3263982a4310c3c6866..e93249c6929e4e962952b1277fef4cd9452808ef 100644 (file)
@@ -41,9 +41,12 @@ DATABASES = {
     },
 }
 
-DATABASES['default']['TEST'] = {
-    'CHARSET': 'utf8',
-}
+if django.VERSION < (1, 7):
+    DATABASES['default']['TEST_CHARSET'] = 'utf8'
+else:
+    DATABASES['default']['TEST'] = {
+        'CHARSET': 'utf8',
+    }
 
 #
 # Patchwork settings
index 41d6284a57d64e3821f7dcefe6bf7718abd206aa..9cf6712ec1a19d6ef0cdb2a837610c49a8cfdd1c 100644 (file)
@@ -56,3 +56,4 @@ DATABASES = {
 #
 
 STATIC_ROOT = '/srv/patchwork/htdocs/static'
+
index 0af569344ab3721cd5a0e60c275352ce1c14e3ea..80285dbd6d6eefe7e37b37e7dec844097b7786c4 100644 (file)
@@ -21,7 +21,10 @@ import errno
 import os
 import time
 
-from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+try:  # django 1.7+
+    from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+except:
+    from django.test import LiveServerTestCase as StaticLiveServerTestCase
 from selenium.common.exceptions import (
         NoSuchElementException, StaleElementReferenceException,
         TimeoutException)