Normalized check that ALLOWED_INCLUDE_ROOTS is a tuple.

This commit is contained in:
Aymeric Augustin 2014-11-17 22:49:01 +01:00
parent a37f452513
commit 4b9eb7602d
1 changed files with 6 additions and 4 deletions

View File

@ -74,9 +74,6 @@ class BaseSettings(object):
def __setattr__(self, name, value):
if name in ("MEDIA_URL", "STATIC_URL") and value and not value.endswith('/'):
raise ImproperlyConfigured("If set, %s must end with a slash" % name)
elif name == "ALLOWED_INCLUDE_ROOTS" and isinstance(value, six.string_types):
raise ValueError("The ALLOWED_INCLUDE_ROOTS setting must be set "
"to a tuple, not a string.")
object.__setattr__(self, name, value)
@ -92,7 +89,12 @@ class Settings(BaseSettings):
mod = importlib.import_module(self.SETTINGS_MODULE)
tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS", "LOCALE_PATHS")
tuple_settings = (
"ALLOWED_INCLUDE_ROOTS",
"INSTALLED_APPS",
"TEMPLATE_DIRS",
"LOCALE_PATHS",
)
self._explicit_settings = set()
for setting in dir(mod):
if setting.isupper():