From 9f629a26dc401654a724e3bd0d56a3414fe6a33a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 18 2015 11:04:26 +0000 Subject: When removing a tag to an issue, notify redis if asked With this change, when a tag is removied on an issue, if there is a redis connection available, it will queue a message information about which tag(s) was/were removed to the channel of this specific issue. --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index ee781fc..5adee6c 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -486,7 +486,7 @@ def remove_tags(session, project, tags, ticketfolder, user): return msgs -def remove_tags_issue(session, issue, tags, ticketfolder, user): +def remove_tags_issue(session, issue, tags, ticketfolder, user, redis=None): ''' Removes the specified tag(s) of a issue. ''' user_obj = __get_user(session, user) @@ -514,6 +514,9 @@ def remove_tags_issue(session, issue, tags, ticketfolder, user): ) ) + if redis: + redis.publish(issue.uid, json.dumps({'removed_tags': removed_tags})) + return 'Removed tag: %s' % ', '.join(removed_tags)