From 50f9a36cbde8bda06e9afd74217f6c35a8ec7e80 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 24 2016 13:33:41 +0000 Subject: Specify if the comment was a notification in the redis message And only convert to markdown if it is not a notification --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 592fbec..af2cdff 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -817,9 +817,13 @@ def add_pull_request_comment(session, request, commit, tree_id, filename, # Send notification for the event-source server if REDIS: + comment_text = pr_comment.comment + if not notification: + comment_text = text2markdown(pr_comment.comment) + REDIS.publish('pagure.%s' % request.uid, json.dumps({ 'request_id': request.id, - 'comment_added': text2markdown(pr_comment.comment), + 'comment_added': comment_text, 'comment_user': pr_comment.user.user, 'comment_id': pr_comment.id, 'avatar_url': avatar_url_from_openid( @@ -828,6 +832,7 @@ def add_pull_request_comment(session, request, commit, tree_id, filename, 'commit_id': commit, 'filename': filename, 'line': row, + 'notification': notification, })) pagure.lib.notify.log(