comparison sat/plugins/plugin_exp_invitation.py @ 3859:3ef988734869

core: fix calls to `domish.Element.elements`: domish.Element.elements should be called with namespace and element name as 2 arguments, but it has been confused in several places with the call to `domish.Element.addElement` which is often done with a `(namespace, name)` tuple. Unfortunately calling with a tuple is accepted and doesn't raise any error in `elements`, but this result in a wrong element returned. This patch fixes the erroneous calls.
author Goffi <goffi@goffi.org>
date Wed, 20 Jul 2022 17:12:29 +0200
parents e2a1ac1afb38
children 524856bd7b19
comparison
equal deleted inserted replaced
3858:6e785662dd7d 3859:3ef988734869
266 raise exceptions.DataError 266 raise exceptions.DataError
267 267
268 args = [service, node, item_id, item_elt] 268 args = [service, node, item_id, item_elt]
269 else: 269 else:
270 try: 270 try:
271 node_data_elt = next(pubsub_elt.elements((NS_INVITATION, "node_data"))) 271 node_data_elt = next(pubsub_elt.elements(NS_INVITATION, "node_data"))
272 except StopIteration: 272 except StopIteration:
273 raise exceptions.DataError("Bad invitation, ignoring") 273 raise exceptions.DataError("Bad invitation, ignoring")
274 namespace = node_data_elt['namespace'] 274 namespace = node_data_elt['namespace']
275 args = [service, node, None, node_data_elt] 275 args = [service, node, None, node_data_elt]
276 276