From 540397aa29271c678652c140ea490a4182bbb64e Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Feb 06 2017 14:15:12 +0000 Subject: Remove duplicate new lines from update_tags function --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index c78554b..c5a3d81 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -2528,9 +2528,9 @@ def update_tags(session, obj, tags, username, ticketfolder): ) ) if len(toadd) == 1: - comment += "**Tags** added tag: ``%s``\n" % list(toadd)[0] + comment += "**Tags** added tag: ``%s``" % list(toadd)[0] else: - comment += "**Tags** added tags: ``" + ', '.join(toadd) + "``\n" + comment += "**Tags** added tags: ``" + ', '.join(toadd) + "``" if torm: messages.append( @@ -2542,10 +2542,12 @@ def update_tags(session, obj, tags, username, ticketfolder): ticketfolder=ticketfolder, ) ) + if toadd: + comment += '\n' if len(torm) == 1: - comment += "**Tags** removed tag: ``%s\n``" % list(torm)[0] + comment += "**Tags** removed tag: ``%s``" % list(torm)[0] else: - comment += "**Tags** removed tags: ``" + ', '.join(torm) + "``\n" + comment += "**Tags** removed tags: ``" + ', '.join(torm) + "``" session.commit()