changeset 437:454f61a32427

backend: fixed item retractation notification
author Goffi <goffi@goffi.org>
date Mon, 08 Feb 2021 19:01:29 +0100
parents 80aca1cf1543
children b5e1e8d93dd4
files sat_pubsub/backend.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sat_pubsub/backend.py	Thu Feb 04 11:10:24 2021 +0100
+++ b/sat_pubsub/backend.py	Mon Feb 08 19:01:29 2021 +0100
@@ -1205,7 +1205,7 @@
         items_data = await node.getItemsById(None, True, itemIdentifiers)
         # Remove the items and keep only actually removed ones in items_data
         removed = await node.removeItems(itemIdentifiers)
-        retracted_items = [
+        retracted_items_data = [
             item_data for item_data in items_data if item_data.item["id"] in removed
         ]
         if nodeIdentifier.startswith(const.FDP_TEMPLATE_PREFIX):
@@ -1232,9 +1232,9 @@
                         submitted_node.setSchema(current_schema)
 
         if notify:
-            await self._doNotifyRetraction(retracted_items, node, pep, recipient)
+            self._doNotifyRetraction(retracted_items_data, node, pep, recipient)
 
-        return retracted_items
+        return [r.item for r in retracted_items_data]
 
     def _doNotifyRetraction(self, items_data, node, pep, recipient):
         self.dispatch({'items_data': items_data,