Fix the @wrap_settings annotation

It seems much more useful if it only adds settings that are not already
set.
This commit is contained in:
mcarton
2015-08-17 15:46:29 +02:00
parent 4a2f869c6d
commit 88831c424f
3 changed files with 10 additions and 6 deletions
+5 -3
View File
@@ -23,7 +23,9 @@ class Settings(dict):
return self.get(item)
def update(self, **kwargs):
"""Returns new settings with new values from `kwargs`."""
conf = dict(self)
conf.update(kwargs)
"""
Returns new settings with values from `kwargs` for unset settings.
"""
conf = dict(kwargs)
conf.update(self)
return Settings(conf)