comparison frontends/src/quick_frontend/quick_blog.py @ 1848:446a1539c207

quick_frontend (blog): fixes main item update (comment's data were lost)
author souliane <souliane@mailoo.org>
date Mon, 22 Feb 2016 13:15:02 +0100
parents d17772b0fe22
children a754d6381550
comparison
equal deleted inserted replaced
1847:d8c6c55aafd7 1848:446a1539c207
246 246
247 def send(self): 247 def send(self):
248 """Send entry according to parent QuickBlog configuration and current level""" 248 """Send entry according to parent QuickBlog configuration and current level"""
249 249
250 # keys to keep other than content*, title* and tag* 250 # keys to keep other than content*, title* and tag*
251 keys_to_keep = ('id', 'comments', 'author', 'author_jid', 'published') 251 # FIXME: see how to avoid comments node hijacking (someone could bind his post to another post's comments node)
252 keys_to_keep = ('id', 'comments', 'author', 'author_jid', 'published', 'comments_node', 'comments_service')
252 253
253 mb_data = {} 254 mb_data = {}
254 for key in keys_to_keep: 255 for key in keys_to_keep:
255 value = getattr(self.item, key) 256 value = getattr(self.item, key)
256 if value is not None: 257 if value is not None:
267 268
268 if self.blog.new_message_target not in (C.PUBLIC, C.GROUP): 269 if self.blog.new_message_target not in (C.PUBLIC, C.GROUP):
269 raise NotImplementedError 270 raise NotImplementedError
270 271
271 if self.level == 0: 272 if self.level == 0:
272 if self.new: 273 mb_data["allow_comments"] = C.BOOL_TRUE
273 mb_data["allow_comments"] = C.BOOL_TRUE
274 274
275 if self.blog.new_message_target == C.GROUP: 275 if self.blog.new_message_target == C.GROUP:
276 common.iter2dict('group', self.blog.targets, mb_data) 276 common.iter2dict('group', self.blog.targets, mb_data)
277 277
278 self.blog.host.bridge.mbSend( 278 self.blog.host.bridge.mbSend(