# HG changeset patch # User souliane # Date 1441863193 -7200 # Node ID 91631837ce5cbeffea56996ca92783759944dce0 # Parent 72e6ee3fdf536061d26819c7fcb7b117275c02ff tmp (wokkel): fixes RSM implementation to fit sat_pubsub answer when in "unrestricted" mode diff -r 72e6ee3fdf53 -r 91631837ce5c src/tmp/wokkel/pubsub.py --- a/src/tmp/wokkel/pubsub.py Wed Sep 02 14:59:28 2015 +0200 +++ b/src/tmp/wokkel/pubsub.py Thu Sep 10 07:33:13 2015 +0200 @@ -1408,6 +1408,9 @@ items["node"] = request.nodeIdentifier for item in result: + if isinstance(item, tuple): + # XXX: see sat_pubsub.pgsql_storage.LeafNode.getItemsById return value + item = item[0] if item.name == 'item': item.uri = NS_PUBSUB items.addChild(item) diff -r 72e6ee3fdf53 -r 91631837ce5c src/tmp/wokkel/rsm.py --- a/src/tmp/wokkel/rsm.py Wed Sep 02 14:59:28 2015 +0200 +++ b/src/tmp/wokkel/rsm.py Thu Sep 10 07:33:13 2015 +0200 @@ -368,9 +368,12 @@ def _toResponse_items(self, result, resource, request): response = pubsub.PubSubService._toResponse_items(self, result, resource, request) - set_elts = [elt for elt in result if elt.name == 'set'] - if set_elts: - assert len(set_elts) == 1 - response.addChild(set_elts[0]) + for item in result: + if isinstance(item, tuple): + # XXX: see sat_pubsub.pgsql_storage.LeafNode.getItemsById return value + item = item[0] + if item.name == set: + response.addChild(item) + break return response