# HG changeset patch # User Goffi # Date 1495190274 -7200 # Node ID f87b673c7d17c1c84e0b74fef9335365ad502d4a # Parent 4b66f070cfbb526311c21f80f2999a74926f208f plugin invitations: on modify an empty value delete corresponding extra keys, and reserved keys are now ignored. diff -r 4b66f070cfbb -r f87b673c7d17 src/plugins/plugin_misc_invitations.py --- a/src/plugins/plugin_misc_invitations.py Fri May 19 12:34:33 2017 +0200 +++ b/src/plugins/plugin_misc_invitations.py Fri May 19 12:37:54 2017 +0200 @@ -294,6 +294,7 @@ @param id_(unicode): UUID linked to an invitation @param new_extra(dict[unicode, unicode]): data to update + empty values will be deleted if replace is True @param replace(bool): if True replace the data else update them @raise KeyError: there is not invitation with this id_ @@ -310,7 +311,16 @@ else: new_data = current_data for k,v in new_extra.iteritems(): - new_data[k] = v + if k in EXTRA_RESERVED: + log.warning(_(u"Skipping reserved key {key}".format(k))) + continue + if v: + new_data[k] = v + else: + try: + del new_data[k] + except KeyError: + pass self.invitations[id_] = new_data