def new_comment():
data = request.json
comments_dir = app._config['henet']['comments_dir']
article_uuid = data['source_path']
article_thread = ArticleThread(comments_dir, article_uuid)
article_thread.add_comment(text=data['text'],
author=data['author'])
article_thread.save()
notifs = app._config['notifications']
moderator = notifs.get('moderate_comment')
if moderator is not None:
app.send_email([moderator], u'Nouveau commentaire',
MODERATE_BODY)
emit(EVENT_CREATED_COMMENT, article_uuid=article_uuid)
return {'result': 'OK'}
评论列表
文章目录