[PATCH 09/10] settings: Place most-used path first
Stephen Finucane
stephen.finucane at intel.com
Mon Jan 11 10:07:58 AEDT 2016
Make the settings file a little easier to parse by placing the most
used (i.e. the one used with recent versions of Django) first.
Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
patchwork/settings/base.py | 6 +++---
patchwork/settings/dev.py | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py
index 5f51e47..ef2a9ee 100644
--- a/patchwork/settings/base.py
+++ b/patchwork/settings/base.py
@@ -37,11 +37,11 @@ MIDDLEWARE_CLASSES = [
'django.middleware.csrf.CsrfViewMiddleware',
]
-if django.VERSION < (1, 7):
- MIDDLEWARE_CLASSES.append('django.middleware.doc.XViewMiddleware')
-else:
+if django.VERSION >= (1, 7):
MIDDLEWARE_CLASSES.append(
'django.contrib.admindocs.middleware.XViewMiddleware')
+else:
+ MIDDLEWARE_CLASSES.append('django.middleware.doc.XViewMiddleware')
# Globalization
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 20626c6..29732aa 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -49,12 +49,12 @@ DATABASES = {
if os.getenv('PW_TEST_DB_TYPE', None) == 'postgre':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
-if django.VERSION < (1, 7):
- DATABASES['default']['TEST_CHARSET'] = 'utf8'
-else:
+if django.VERSION >= (1, 7):
DATABASES['default']['TEST'] = {
'CHARSET': 'utf8',
}
+else:
+ DATABASES['default']['TEST_CHARSET'] = 'utf8'
# Email
--
2.0.0
More information about the Patchwork
mailing list