comparison src/pages/common/blog/page_meta.py @ 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
comparison
equal deleted inserted replaced
1038:6b906b1f419a 1039:6bc7768faa5d
86 @defer.inlineCallbacks 86 @defer.inlineCallbacks
87 def appendComments(self, blog_items, identities, profile): 87 def appendComments(self, blog_items, identities, profile):
88 for blog_item in blog_items: 88 for blog_item in blog_items:
89 if identities is not None: 89 if identities is not None:
90 author = blog_item.author_jid 90 author = blog_item.author_jid
91 if author not in identities: 91 if not author:
92 identities[author] = yield self.host.bridgeCall(u'identityGet', author, profile) 92 log.warning(_(u"no author found for item {item_id}").format(item_id=blog_item.id))
93 else:
94 if author not in identities:
95 identities[author] = yield self.host.bridgeCall(u'identityGet', author, profile)
93 for comment_data in blog_item.comments: 96 for comment_data in blog_item.comments:
94 service = comment_data[u'service'] 97 service = comment_data[u'service']
95 node = comment_data[u'node'] 98 node = comment_data[u'node']
96 try: 99 try:
97 comments_data = yield self.host.bridge.mbGet( 100 comments_data = yield self.host.bridge.mbGet(