changeset 1039:6bc7768faa5d

pages (common/blog): don't fail if author is missing
author Goffi <goffi@goffi.org>
date Wed, 24 Jan 2018 09:58:00 +0100
parents 6b906b1f419a
children 90b11cd6f28f
files src/pages/common/blog/page_meta.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/pages/common/blog/page_meta.py	Wed Jan 24 09:57:57 2018 +0100
+++ b/src/pages/common/blog/page_meta.py	Wed Jan 24 09:58:00 2018 +0100
@@ -88,8 +88,11 @@
     for blog_item in blog_items:
         if identities is not None:
             author = blog_item.author_jid
-            if author not in identities:
-                identities[author] = yield self.host.bridgeCall(u'identityGet', author, profile)
+            if not author:
+                log.warning(_(u"no author found for item {item_id}").format(item_id=blog_item.id))
+            else:
+                if author not in identities:
+                    identities[author] = yield self.host.bridgeCall(u'identityGet', author, profile)
         for comment_data in blog_item.comments:
             service = comment_data[u'service']
             node = comment_data[u'node']