# HG changeset patch # User Thomas De Schampheleire # Date 1604611033 -3600 # Node ID 78059b94991e757ab1e187a40a16d472e9d5661d # Parent cdcebb7c290098bf20f2ad874315d2f485e76a0a model/comment: inline _get_notification_data This method was only used in one place, from code which was very related. Inline it to group things together and reduce complexity. diff -r cdcebb7c2900 -r 78059b94991e kallithea/model/comment.py --- a/kallithea/model/comment.py Thu Nov 05 22:04:05 2020 +0100 +++ b/kallithea/model/comment.py Thu Nov 05 22:17:13 2020 +0100 @@ -54,13 +54,10 @@ class ChangesetCommentsModel(object): - def _get_notification_data(self, repo, comment, author, comment_text, - line_no=None, revision=None, pull_request=None, - status_change=None, closing_pr=False): - """ - :returns: tuple (subj,body,recipients,notification_type,email_kwargs) - """ - # make notification + def create_notification(self, repo, comment, author, comment_text, + line_no=None, revision=None, pull_request=None, + status_change=None, closing_pr=False): + body = comment_text # text of the comment line = '' if line_no: @@ -160,23 +157,6 @@ 'threading': threading, } - return subj, body, recipients, notification_type, email_kwargs - - def create_notification(self, repo, comment, author, comment_text, - line_no=None, revision=None, pull_request=None, - status_change=None, closing_pr=False): - - - (subj, body, recipients, notification_type, email_kwargs) = self._get_notification_data( - repo, comment, author, - comment_text=comment_text, - line_no=line_no, - revision=revision, - pull_request=pull_request, - status_change=status_change, - closing_pr=closing_pr, - ) - email_kwargs['is_mention'] = False # create notification objects, and emails notification.NotificationModel().create(