diff --git a/kallithea/model/comment.py b/kallithea/model/comment.py --- a/kallithea/model/comment.py +++ b/kallithea/model/comment.py @@ -213,6 +213,7 @@ class ChangesetCommentsModel(BaseModel): if mention_recipients: email_kwargs['is_mention'] = True subj = _('[Mention]') + ' ' + subj + # FIXME: this subject is wrong and unused! NotificationModel().create( created_by=user, subject=subj, body=body, recipients=mention_recipients, diff --git a/kallithea/model/pull_request.py b/kallithea/model/pull_request.py --- a/kallithea/model/pull_request.py +++ b/kallithea/model/pull_request.py @@ -185,6 +185,7 @@ class PullRequestModel(BaseModel): if mention_recipients: email_kwargs['is_mention'] = True subject = _('[Mention]') + ' ' + subject + # FIXME: this subject is wrong and unused! NotificationModel().create(created_by=user, subject=subject, body=body, recipients=mention_recipients, type_=Notification.TYPE_PULL_REQUEST, diff --git a/kallithea/tests/models/test_dump_html_mails.ref.html b/kallithea/tests/models/test_dump_html_mails.ref.html --- a/kallithea/tests/models/test_dump_html_mails.ref.html +++ b/kallithea/tests/models/test_dump_html_mails.ref.html @@ -411,7 +411,7 @@ This is an automatic notification. Don&#
--------------------
-

pull_request_comment, status_change=None, closing_pr=False

+

pull_request_comment, is_mention=False, status_change=None, closing_pr=False

 
 From: u1
@@ -454,7 +454,50 @@ This is an automatic notification. Don&#
 
--------------------
-

pull_request_comment, status_change='Under Review', closing_pr=False

+

pull_request_comment, is_mention=True, status_change=None, closing_pr=False

+
+
+From: u1
+To: u2@example.com
+Subject: [Comment] repo/name pull request #7 from devbranch
+
+--------------------
+
+
+Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Me too!
+
+ - and indented on second line
+
+
+URL: http://pr.org/comment
+
+
+--
+This is an automatic notification. Don't reply to this mail.
+
+--------------------
+ + + +

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

+

Me too! + + - and indented on second line

+ + +

URL: http://pr.org/comment

+ + +
+
+--
+This is an automatic notification. Don't reply to this mail. + +
--------------------
+ + +

pull_request_comment, is_mention=False, status_change='Under Review', closing_pr=False

 
 From: u1
@@ -499,7 +542,52 @@ This is an automatic notification. Don&#
 
--------------------
-

pull_request_comment, status_change=None, closing_pr=True

+

pull_request_comment, is_mention=True, status_change='Under Review', closing_pr=False

+
+
+From: u1
+To: u2@example.com
+Subject: [Under Review: Comment] repo/name pull request #7 from devbranch
+
+--------------------
+
+
+Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Me too!
+
+ - and indented on second line
+
+The comment was made with status: Under Review
+
+URL: http://pr.org/comment
+
+
+--
+This is an automatic notification. Don't reply to this mail.
+
+--------------------
+ + + +

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

+

Me too! + + - and indented on second line

+ +

The comment was made with status: Under Review

+ +

URL: http://pr.org/comment

+ + +
+
+--
+This is an automatic notification. Don't reply to this mail. + +
--------------------
+ + +

pull_request_comment, is_mention=False, status_change=None, closing_pr=True

 
 From: u1
@@ -542,7 +630,95 @@ This is an automatic notification. Don&#
 
--------------------
-

pull_request_comment, status_change='Under Review', closing_pr=True

+

pull_request_comment, is_mention=True, status_change=None, closing_pr=True

+
+
+From: u1
+To: u2@example.com
+Subject: [Closing: Comment] repo/name pull request #7 from devbranch
+
+--------------------
+
+
+Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Me too!
+
+ - and indented on second line
+
+
+URL: http://pr.org/comment
+
+
+--
+This is an automatic notification. Don't reply to this mail.
+
+--------------------
+ + + +

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

+

Me too! + + - and indented on second line

+ + +

URL: http://pr.org/comment

+ + +
+
+--
+This is an automatic notification. Don't reply to this mail. + +
--------------------
+ + +

pull_request_comment, is_mention=False, status_change='Under Review', closing_pr=True

+
+
+From: u1
+To: u2@example.com
+Subject: [Under Review, Closing: Comment] repo/name pull request #7 from devbranch
+
+--------------------
+
+
+Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Me too!
+
+ - and indented on second line
+
+The comment closed the pull request with status: Under Review
+
+URL: http://pr.org/comment
+
+
+--
+This is an automatic notification. Don't reply to this mail.
+
+--------------------
+ + + +

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

+

Me too! + + - and indented on second line

+ +

The comment closed the pull request with status: Under Review

+ +

URL: http://pr.org/comment

+ + +
+
+--
+This is an automatic notification. Don't reply to this mail. + +
--------------------
+ + +

pull_request_comment, is_mention=True, status_change='Under Review', closing_pr=True

 
 From: u1
diff --git a/kallithea/tests/models/test_notifications.py b/kallithea/tests/models/test_notifications.py
--- a/kallithea/tests/models/test_notifications.py
+++ b/kallithea/tests/models/test_notifications.py
@@ -231,6 +231,7 @@ class TestNotifications(TestController):
                  u'Me too!\n\n - and indented on second line',
                  dict(
                     closing_pr=[False, True],
+                    is_mention=[False, True],
                     pr_comment_user='Opinionated User (jsmith)',
                     pr_comment_url='http://pr.org/comment',
                     status_change=[None, 'Under Review'],