diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2011-11-20 22:26:55 +0200 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2011-11-20 22:26:55 +0200 |
commit | 564bd4f53033a8248266ac871e7b93ac00e08535 (patch) | |
tree | be68864fec9f3119363a0f3124cd2b013f140408 /rhodecode/model/comment.py | |
parent | aaa1e55d8c64cb82696ebf05bd82215db0c17633 (diff) |
notification fixes and improvements
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/comment.py')
-rw-r--r-- | rhodecode/model/comment.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rhodecode/model/comment.py b/rhodecode/model/comment.py index 56357f50..4fe5fde1 100644 --- a/rhodecode/model/comment.py +++ b/rhodecode/model/comment.py @@ -28,8 +28,9 @@ import logging import traceback from rhodecode.model import BaseModel -from rhodecode.model.db import ChangesetComment +from rhodecode.model.db import ChangesetComment, User, Notification from sqlalchemy.util.compat import defaultdict +from rhodecode.model.notification import NotificationModel log = logging.getLogger(__name__) @@ -60,6 +61,17 @@ class ChangesetCommentsModel(BaseModel): self.sa.add(comment) self.sa.commit() + + # make notification + usr = User.get(user_id) + subj = 'User %s commented on %s' % (usr.username, revision) + body = text + recipients = ChangesetComment.get_users(revision=revision) + NotificationModel().create(created_by=user_id, subject=subj, + body = body, recipients = recipients, + type_ = Notification.TYPE_CHANGESET_COMMENT) + + return comment def delete(self, comment_id): |