From 099e8068d9a3d0a52a43e01d55d250e5aebd9586 Mon Sep 17 00:00:00 2001
From: Martin Basti <mbasti@redhat.com>
Date: Mar 17 2017 09:15:00 +0000
Subject: Remove backticks from email subject


Fixes: https://pagure.io/pagure/issue/2095

---

diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py
index 7da3079..a04957b 100644
--- a/pagure/lib/notify.py
+++ b/pagure/lib/notify.py
@@ -320,7 +320,7 @@ def notify_new_comment(comment, user=None):
 
     send_email(
         text,
-        'Issue #%s `%s`' % (comment.issue.id, comment.issue.title),
+        'Issue #%s: %s' % (comment.issue.id, comment.issue.title),
         ','.join(mail_to),
         mail_id=comment.mail_id,
         in_reply_to=comment.issue.mail_id,
@@ -356,7 +356,7 @@ def notify_new_issue(issue, user=None):
 
     send_email(
         text,
-        'Issue #%s `%s`' % (issue.id, issue.title),
+        'Issue #%s: %s' % (issue.id, issue.title),
         ','.join(mail_to),
         mail_id=issue.mail_id,
         project_name=issue.project.fullname,
@@ -392,7 +392,7 @@ The issue: `%s` of project: `%s` has been %s by %s.
     uid = time.mktime(datetime.datetime.now().timetuple())
     send_email(
         text,
-        'Issue #%s `%s`' % (issue.id, issue.title),
+        'Issue #%s: %s' % (issue.id, issue.title),
         ','.join(mail_to),
         mail_id='%s/assigned/%s' % (issue.mail_id, uid),
         in_reply_to=issue.mail_id,
@@ -425,7 +425,7 @@ The status of the issue: `%s` of project: `%s` has been updated to: %s by %s.
     uid = time.mktime(datetime.datetime.now().timetuple())
     send_email(
         text,
-        'Issue #%s `%s`' % (issue.id, issue.title),
+        'Issue #%s: %s' % (issue.id, issue.title),
         ','.join(mail_to),
         mail_id='%s/close/%s' % (issue.mail_id, uid),
         in_reply_to=issue.mail_id,
@@ -454,7 +454,7 @@ def notify_meta_change_issue(issue, user, msg):
     uid = time.mktime(datetime.datetime.now().timetuple())
     send_email(
         text,
-        'Issue #%s `%s`' % (issue.id, issue.title),
+        'Issue #%s: %s' % (issue.id, issue.title),
         ','.join(mail_to),
         mail_id='%s/close/%s' % (issue.mail_id, uid),
         in_reply_to=issue.mail_id,
@@ -491,7 +491,7 @@ The pull-request: `%s` of project: `%s` has been %s by %s.
     uid = time.mktime(datetime.datetime.now().timetuple())
     send_email(
         text,
-        'PR #%s `%s`' % (request.id, request.title),
+        'PR #%s: %s' % (request.id, request.title),
         ','.join(mail_to),
         mail_id='%s/assigned/%s' % (request.mail_id, uid),
         in_reply_to=request.mail_id,
@@ -525,7 +525,7 @@ def notify_new_pull_request(request):
 
     send_email(
         text,
-        'PR #%s `%s`' % (request.id, request.title),
+        'PR #%s: %s' % (request.id, request.title),
         ','.join(mail_to),
         mail_id=request.mail_id,
         project_name=request.project.fullname,
@@ -560,7 +560,7 @@ Merged pull-request:
     uid = time.mktime(datetime.datetime.now().timetuple())
     send_email(
         text,
-        'PR #%s `%s`' % (request.id, request.title),
+        'PR #%s: %s' % (request.id, request.title),
         ','.join(mail_to),
         mail_id='%s/close/%s' % (request.mail_id, uid),
         in_reply_to=request.mail_id,
@@ -596,7 +596,7 @@ Cancelled pull-request:
     uid = time.mktime(datetime.datetime.now().timetuple())
     send_email(
         text,
-        'PR #%s `%s`' % (request.id, request.title),
+        'PR #%s: %s' % (request.id, request.title),
         ','.join(mail_to),
         mail_id='%s/close/%s' % (request.mail_id, uid),
         in_reply_to=request.mail_id,
@@ -632,7 +632,7 @@ def notify_pull_request_comment(comment, user):
 
     send_email(
         text,
-        'PR #%s `%s`' % (comment.pull_request.id, comment.pull_request.title),
+        'PR #%s: %s' % (comment.pull_request.id, comment.pull_request.title),
         ','.join(mail_to),
         mail_id=comment.mail_id,
         in_reply_to=comment.pull_request.mail_id,
diff --git a/tests/test_pagure_lib_notify_email.py b/tests/test_pagure_lib_notify_email.py
index 88270fe..26371cd 100644
--- a/tests/test_pagure_lib_notify_email.py
+++ b/tests/test_pagure_lib_notify_email.py
@@ -119,7 +119,7 @@ https://pagure.org/test/issue/1
         self.assertEqual(args[0], exptext)
 
         # Mail subject should be as expected.
-        self.assertEqual(args[1], u'Issue #1 `issue`')
+        self.assertEqual(args[1], u'Issue #1: issue')
 
         # Mail should be sent to user #1.
         self.assertEqual(args[2], self.user1.default_email)
@@ -155,7 +155,7 @@ https://pagure.org/somenamespace/test3/issue/1
         self.assertEqual(args[0], exptext)
 
         # Mail subject should be as expected.
-        self.assertEqual(args[1], u'Issue #1 `namespaced project issue`')
+        self.assertEqual(args[1], u'Issue #1: namespaced project issue')
 
         # Mail should be sent to user #1.
         self.assertEqual(args[2], self.user1.default_email)
@@ -186,7 +186,7 @@ https://pagure.org/fork/foo/test/issue/1
         self.assertEqual(args[0], exptext)
 
         # Mail subject should be as expected.
-        self.assertEqual(args[1], u'Issue #1 `forked project issue`')
+        self.assertEqual(args[1], u'Issue #1: forked project issue')
 
         # Mail should be sent to user #1.
         # NOTE: Not sent to user #2...

