From 9fd2e5a2005c086c41e281488f8144dad041c2ff Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 14 2015 16:08:53 +0000 Subject: Drop the redis argument and use the global instance --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index ff3522c..cfd6f55 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -835,7 +835,7 @@ def add_pull_request_comment(session, request, commit, filename, row, def edit_comment(session, parent, comment, user, - updated_comment, folder, redis): + updated_comment, folder): ''' Edit a comment. ''' user_obj = __get_user(session, user) comment.comment = updated_comment @@ -863,12 +863,13 @@ def edit_comment(session, parent, comment, user, msg={ key: parent.to_json(public=True), 'agent': user_obj.username, - } + }, + redis=REDIS, ) - if redis: - redis.publish(request.uid, json.dumps({ - id_: len(request.comments), + if REDIS: + REDIS.publish(parent.uid, json.dumps({ + id_: len(parent.comments), 'comment_updated': text2markdown(comment.comment), 'comment_id': comment.id, 'comment_editor': user_obj.user,