diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2012-04-01 01:43:40 +0300 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2012-04-01 01:43:40 +0300 |
commit | fe1f68f8ff4d9682860608ac5fcf2644d21261f2 (patch) | |
tree | e19c0b4f89c07197ff8e802d165e9600e113045d /rhodecode/model/comment.py | |
parent | 0836f2e7787e36a7cde12ea808bb8dabba244de4 (diff) |
Notification fixes
- added cs ID to notification on changeset comment
- trimmed long commits to 256 chars
- cast to unicode the link re ticket #418
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/comment.py')
-rw-r--r-- | rhodecode/model/comment.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/rhodecode/model/comment.py b/rhodecode/model/comment.py index fb132b7a..21e40de8 100644 --- a/rhodecode/model/comment.py +++ b/rhodecode/model/comment.py @@ -29,7 +29,7 @@ import traceback from pylons.i18n.translation import _ from sqlalchemy.util.compat import defaultdict -from rhodecode.lib.utils2 import extract_mentioned_users +from rhodecode.lib.utils2 import extract_mentioned_users, safe_unicode from rhodecode.lib import helpers as h from rhodecode.model import BaseModel from rhodecode.model.db import ChangesetComment, User, Repository, Notification @@ -67,7 +67,7 @@ class ChangesetCommentsModel(BaseModel): if text: repo = Repository.get(repo_id) cs = repo.scm_instance.get_changeset(revision) - desc = cs.message + desc = "%s - %s" % (cs.short_id, h.shorter(cs.message, 256)) author_email = cs.author_email comment = ChangesetComment() comment.repo = repo @@ -83,14 +83,17 @@ class ChangesetCommentsModel(BaseModel): line = '' if line_no: line = _('on line %s') % line_no - subj = h.link_to('Re commit: %(commit_desc)s %(line)s' % \ - {'commit_desc': desc, 'line': line}, - h.url('changeset_home', repo_name=repo.repo_name, - revision=revision, - anchor='comment-%s' % comment.comment_id, - qualified=True, - ) - ) + subj = safe_unicode( + h.link_to('Re commit: %(commit_desc)s %(line)s' % \ + {'commit_desc': desc, 'line': line}, + h.url('changeset_home', repo_name=repo.repo_name, + revision=revision, + anchor='comment-%s' % comment.comment_id, + qualified=True, + ) + ) + ) + body = text # get the current participants of this changeset |