From 2d821eb739d7e3e627aec08908c16a623462fe45 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 25 2015 11:04:38 +0000 Subject: Rework remove_tags_issue removing tags of an issue - Require to know the user performing the action (removing the tag(s)) - Store a list of the tags that were actually removed --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 0574d51..3905782 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -316,16 +316,19 @@ def remove_tags(session, project, tags, ticketfolder, user): return msgs -def remove_tags_issue(session, issue, tags, ticketfolder): +def remove_tags_issue(session, issue, tags, ticketfolder, user): ''' Removes the specified tag(s) of a issue. ''' + user_obj = __get_user(session, user) if isinstance(tags, basestring): tags = [tags] msgs = [] + removed_tags = [] for issue_tag in issue.tags: if issue_tag.tag in tags: tag = issue_tag.tag + removed_tags.append(tag) session.delete(issue_tag) msgs.append('Removed tag: %s' % tag)