diff src/server/blog.py @ 824:d990ae5612df

server (blog): better handling of mbGetFromManyWithCommentsRTResult in getItems
author Goffi <goffi@goffi.org>
date Fri, 08 Jan 2016 18:09:49 +0100
parents 027139763511
children a3e888ac4964
line wrap: on
line diff
--- a/src/server/blog.py	Fri Jan 08 14:42:39 2016 +0100
+++ b/src/server/blog.py	Fri Jan 08 18:09:49 2016 +0100
@@ -309,13 +309,14 @@
         """
         def getResultCb(data, rt_session):
             remaining, results = data
-            for result in results:
-                service, node, failure, items, metadata = result
-                if not failure:
-                    self.renderHTML(items, metadata, request, pub_jid, profile)
-
-            if remaining:
-                self._getResults(rt_session)
+            # we have requested one node only
+            assert remaining == 0
+            assert len(results) == 1
+            service, node, failure, items, metadata = results[0]
+            if failure:
+                self.renderError(failure, request, pub_jid)
+            else:
+                self.renderHTML(items, metadata, request, pub_jid, profile)
 
         def getResult(rt_session):
             self.host.bridge.mbGetFromManyWithCommentsRTResult(rt_session, C.SERVICE_PROFILE,