Commit 4b9eb760 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Normalized check that ALLOWED_INCLUDE_ROOTS is a tuple.

parent a37f4525
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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():