1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Stop auto-correcting string INSTALLED_APPS, TEMPLATE_DIRS settings, as per deprecation TL.

This commit is contained in:
Ramiro Morales 2013-06-28 14:50:06 -03:00
parent f73d04dda9
commit 5e08b792ef

View File

@ -132,19 +132,9 @@ class Settings(BaseSettings):
% (self.SETTINGS_MODULE, e)
)
# Settings that should be converted into tuples if they're mistakenly entered
# as strings.
tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS")
for setting in dir(mod):
if setting == setting.upper():
setting_value = getattr(mod, setting)
if setting in tuple_settings and \
isinstance(setting_value, six.string_types):
warnings.warn("The %s setting must be a tuple. Please fix your "
"settings, as auto-correction is now deprecated." % setting,
DeprecationWarning, stacklevel=2)
setting_value = (setting_value,) # In case the user forgot the comma.
setattr(self, setting, setting_value)
if not self.SECRET_KEY: