Preventing VowsSettings inception leading to a possible infinite recursion

This commit is contained in:
Cezar Sa Espinola 2012-05-25 15:26:50 -03:00
parent b36c86526e
commit 96a08e7914

View file

@ -22,8 +22,10 @@ class SettingsTracker(object):
result = apply(self.real_import, (name, globals, locals, fromlist, level)) result = apply(self.real_import, (name, globals, locals, fromlist, level))
fromlist = (fromlist or []) fromlist = (fromlist or [])
if name == 'django.conf' and 'settings' in fromlist: if name == 'django.conf' and 'settings' in fromlist:
if type(result.settings) != VowsSettings:
result.settings = VowsSettings(result.settings) result.settings = VowsSettings(result.settings)
elif name == 'django' and 'conf' in fromlist: elif name == 'django' and 'conf' in fromlist:
if type(result.conf.settings) != VowsSettings:
result.conf.settings = VowsSettings(result.conf.settings) result.conf.settings = VowsSettings(result.conf.settings)
return result return result