Preventing VowsSettings inception leading to a possible infinite recursion
This commit is contained in:
parent
b36c86526e
commit
96a08e7914
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Reference in a new issue