Changeset - 5fe492c6d7d7
[Not reviewed]
default
0 4 0
Thomas De Schampheleire - 6 years ago 2020-03-22 00:00:44
thomas.de_schampheleire@nokia.com
Grafted from: 78778bb6b969
comments: add changeset author in mail notification subject

In analogy to the handling of comments on pull requests, as changed in
commit d4061c6cc0e2.
4 files changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/model/comment.py
Show inline comments
 
@@ -105,6 +105,7 @@ class ChangesetCommentsModel(object):
 
                '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,
kallithea/model/notification.py
Show inline comments
 
@@ -165,7 +165,7 @@ class EmailNotificationModel(object):
 
            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'),
kallithea/tests/models/test_dump_html_mails.ref.html
Show inline comments
 
@@ -7,7 +7,7 @@
 
<pre>
 
From: u1 u1 <name@example.com>
 
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
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 
@@ -166,7 +166,7 @@ View Comment: http://comment.org
 
<pre>
 
From: u1 u1 <name@example.com>
 
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
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 
@@ -325,7 +325,7 @@ View Comment: http://comment.org
 
<pre>
 
From: u1 u1 <name@example.com>
 
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
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 
@@ -502,7 +502,7 @@ View Comment: http://comment.org
 
<pre>
 
From: u1 u1 <name@example.com>
 
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
 
</pre>
 
<hr/>
 
<pre>http://comment.org
kallithea/tests/models/test_notifications.py
Show inline comments
 
@@ -103,6 +103,7 @@ class TestNotifications(base.TestControl
 
                            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.',
0 comments (0 inline, 0 general)