diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 85ab87f..bccb055 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -206,7 +206,7 @@ def create_user_ssh_keys_on_disk(user, gitolite_keydir): def add_issue_comment(session, issue, comment, user, ticketfolder, - notify=True, date_created=None): + notify=True, date_created=None, notification=False): ''' Add a comment to an issue. ''' user_obj = __get_user(session, user) @@ -215,6 +215,7 @@ def add_issue_comment(session, issue, comment, user, ticketfolder, comment=comment, user_id=user_obj.id, date_created=date_created, + notification=notification, ) session.add(issue_comment) # Make sure we won't have SQLAlchemy error before we continue @@ -255,6 +256,7 @@ def add_issue_comment(session, issue, comment, user, ticketfolder, issue_comment.user.default_email, size=16), 'comment_date': issue_comment.date_created.strftime( '%Y-%m-%d %H:%M:%S'), + 'notification': notification, })) return 'Comment added' diff --git a/pagure/lib/model.py b/pagure/lib/model.py index 44ac79e..ac973cd 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -749,6 +749,7 @@ class IssueComment(BASE): 'user': self.user.to_json(public=public), 'edited_on': self.edited_on.strftime('%s') if self.edited_on else None, 'editor': self.editor.to_json(public=public) if self.editor_id else None, + 'notification': self.notification, } return output