# HG changeset patch # User Thomas De Schampheleire # Date 1584831644 -3600 # Node ID 5fe492c6d7d70ddd36b7c280f9b657068ed92ce3 # Parent f79c40759d6f6de3c7858b8871fcfb3c622fdb9d comments: add changeset author in mail notification subject In analogy to the handling of comments on pull requests, as changed in commit d4061c6cc0e2. diff -r f79c40759d6f -r 5fe492c6d7d7 kallithea/model/comment.py --- a/kallithea/model/comment.py Tue Jan 23 13:31:25 2018 +0100 +++ b/kallithea/model/comment.py Sun Mar 22 00:00:44 2020 +0100 @@ -105,6 +105,7 @@ 'message': cs.message, 'message_short': h.shorter(cs.message, 50, firstline=True), 'cs_author': cs_author, + 'cs_author_username': cs_author.username, 'repo_name': repo.repo_name, 'short_id': h.short_id(revision), 'branch': cs.branch, diff -r f79c40759d6f -r 5fe492c6d7d7 kallithea/model/notification.py --- a/kallithea/model/notification.py Tue Jan 23 13:31:25 2018 +0100 +++ b/kallithea/model/notification.py Sun Mar 22 00:00:44 2020 +0100 @@ -165,7 +165,7 @@ self.TYPE_PULL_REQUEST_COMMENT: 'pull_request_comment', } self._subj_map = { - self.TYPE_CHANGESET_COMMENT: _('[Comment] %(repo_name)s changeset %(short_id)s "%(message_short)s" on %(branch)s'), + self.TYPE_CHANGESET_COMMENT: _('[Comment] %(repo_name)s changeset %(short_id)s "%(message_short)s" on %(branch)s by %(cs_author_username)s'), self.TYPE_MESSAGE: 'Test Message', # self.TYPE_PASSWORD_RESET self.TYPE_REGISTRATION: _('New user %(new_username)s registered'), diff -r f79c40759d6f -r 5fe492c6d7d7 kallithea/tests/models/test_dump_html_mails.ref.html --- a/kallithea/tests/models/test_dump_html_mails.ref.html Tue Jan 23 13:31:25 2018 +0100 +++ b/kallithea/tests/models/test_dump_html_mails.ref.html Sun Mar 22 00:00:44 2020 +0100 @@ -7,7 +7,7 @@
 From: u1 u1 
 To: u2@example.com
-Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
+Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch by u2
 

http://comment.org
@@ -166,7 +166,7 @@
 
 From: u1 u1 
 To: u2@example.com
-Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
+Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch by u2
 

http://comment.org
@@ -325,7 +325,7 @@
 
 From: u1 u1 
 To: u2@example.com
-Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
+Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch by u2
 

http://comment.org
@@ -502,7 +502,7 @@
 
 From: u1 u1 
 To: u2@example.com
-Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
+Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch by u2
 

http://comment.org
diff -r f79c40759d6f -r 5fe492c6d7d7 kallithea/tests/models/test_notifications.py
--- a/kallithea/tests/models/test_notifications.py	Tue Jan 23 13:31:25 2018 +0100
+++ b/kallithea/tests/models/test_notifications.py	Sun Mar 22 00:00:44 2020 +0100
@@ -103,6 +103,7 @@
                             status_change=[None, 'Approved'],
                             cs_target_repo='http://example.com/repo_target',
                             cs_url='http://changeset.com',
+                            cs_author_username=User.get(self.u2).username,
                             cs_author=User.get(self.u2))),
                         (NotificationModel.TYPE_MESSAGE,
                          'This is the \'body\' of the "test" message\n - nothing interesting here except indentation.',