0
0
mirror of https://github.com/django/django.git synced 2024-11-29 22:56:46 +01: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) % (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): for setting in dir(mod):
if setting == setting.upper(): if setting == setting.upper():
setting_value = getattr(mod, setting) 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) setattr(self, setting, setting_value)
if not self.SECRET_KEY: if not self.SECRET_KEY: