diff --git a/src/memory/params.py b/src/memory/params.py index 359c9bf8..52a812aa 100644 --- a/src/memory/params.py +++ b/src/memory/params.py @@ -756,7 +756,8 @@ class Params(object): if type_ == "button": log.debug("Clicked param button %s" % node.toxml()) return defer.succeed(None) - elif type_ == "password": + d = defer.succeed(value) + if type_ == "password": try: personal_key = self.host.memory.auth_sessions.profileGetUnique(profile)[C.MEMORY_CRYPTO_KEY] except TypeError: @@ -770,17 +771,16 @@ class Params(object): d = PasswordHasher.hash(value) # profile password is hashed (empty value stays empty) elif value: # other non empty passwords are encrypted with the personal key d = BlockCipher.encrypt(personal_key, value) - else: - d = defer.succeed(value) def gotFinalValue(value): if self.host.isConnected(profile): # key can not exists if profile is not connected self.params[profile][(category, name)] = value self.host.bridge.paramUpdate(name, value, category, profile) self.host.trigger.point("paramUpdateTrigger", name, value, category, node[0], profile) - d_list.append(self.storage.setIndParam(category, name, value, profile)) + return self.storage.setIndParam(category, name, value, profile) d.addCallback(gotFinalValue) + d_list.append(d) return defer.DeferredList(d_list).addCallback(lambda dummy: None) def _getNodesOfTypes(self, attr_type, node_type="@ALL@"):