From 81beb30160c30b24ce588d4f47d912bc0abdb4aa Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Wed, 6 Jun 2018 16:45:50 +0200 Subject: [PATCH] dont' import everything from global_settings (#24081) --- src/authentic2/settings.py | 13 ++++++++----- tests/settings.py | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/authentic2/settings.py b/src/authentic2/settings.py index 2b935d1c..69e5d904 100644 --- a/src/authentic2/settings.py +++ b/src/authentic2/settings.py @@ -1,7 +1,7 @@ import logging import logging.config # Load default from Django -from django.conf.global_settings import * +from django.conf import global_settings import os import django @@ -9,6 +9,9 @@ import django from gadjo.templatetags.gadjo import xstatic from . import plugins, logger +# debian/debian_config.py::extract_settings_from_environ expects CACHES to be in its NAMESPACE +CACHES = global_settings.CACHES + BASE_DIR = os.path.dirname(__file__) ### Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ @@ -90,7 +93,7 @@ TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'templates'),) STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),) -STATICFILES_FINDERS = STATICFILES_FINDERS + ('gadjo.finders.XStaticFinder',) +STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + ['gadjo.finders.XStaticFinder'] LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), ) @@ -178,14 +181,14 @@ IDP_BACKENDS = plugins.register_plugins_idp_backends(()) # Only https URLS are accepted. # Can be none, sp, idp or both -PASSWORD_HASHERS += ( +PASSWORD_HASHERS = list(global_settings.PASSWORD_HASHERS) + [ 'authentic2.hashers.Drupal7PasswordHasher', 'authentic2.hashers.SHA256PasswordHasher', 'authentic2.hashers.SSHA1PasswordHasher', 'authentic2.hashers.SMD5PasswordHasher', 'authentic2.hashers.SHA1OLDAPPasswordHasher', - 'authentic2.hashers.MD5OLDAPPasswordHasher', -) + 'authentic2.hashers.MD5OLDAPPasswordHasher' +] # Admin tools ADMIN_TOOLS_INDEX_DASHBOARD = 'authentic2.dashboard.CustomIndexDashboard' diff --git a/tests/settings.py b/tests/settings.py index bdde5b7d..eb54a453 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -4,7 +4,7 @@ import os if 'PASSWORD_HASHERS' not in locals(): from django.conf.global_settings import PASSWORD_HASHERS -PASSWORD_HASHERS = ('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',) + PASSWORD_HASHERS +PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher'] + list(PASSWORD_HASHERS) A2_CACHE_ENABLED = False -- 2.17.1