From: Stephen Finucane Date: Sun, 10 Jan 2016 23:00:47 +0000 (+0000) Subject: settings: Place most-used path first X-Git-Tag: v1.1.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08883937e4e0e9fa520df6392630c7e3fa16480;p=thirdparty%2Fpatchwork.git settings: Place most-used path first 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 --- diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 5f51e476..ef2a9ee8 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 20626c63..29732aa2 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