changeset 1269:470c6cfdf4ce

pages (blog): fixed identities handling
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 11:05:47 +0200
parents e628724530ec
children 6dfcdbeb0d33
files libervia/pages/blog/page_meta.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/pages/blog/page_meta.py	Tue May 19 11:05:40 2020 +0200
+++ b/libervia/pages/blog/page_meta.py	Tue May 19 11:05:47 2020 +0200
@@ -38,20 +38,22 @@
         identities = self.host.getSessionData(
             request, session_iface.ISATSession
         ).identities
-        d_list = []
+        d_list = {}
         for entity_jid_s in entities:
             entities_url[entity_jid_s] = self.getPageByName("blog_view").getURL(
                 entity_jid_s
             )
             if entity_jid_s not in identities:
-                d_list.append(self.host.bridgeCall("identityGet",
-                                                   entity_jid_s,
-                                                   [],
-                                                   True,
-                                                   profile))
-        identities_data = yield defer.DeferredList(d_list)
+                d_list[entity_jid_s] = self.host.bridgeCall(
+                        "identityGet",
+                        entity_jid_s,
+                        [],
+                        True,
+                        profile)
+        identities_data = yield defer.DeferredList(d_list.values())
+        entities_idx = list(d_list.keys())
         for idx, (success, identity_raw) in enumerate(identities_data):
-            entity_jid_s = entities[idx]
+            entity_jid_s = entities_idx[idx]
             if not success:
                 log.warning(_("Can't retrieve identity of {entity}")
                     .format(entity=entity_jid_s))