aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/model/comment.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-01-21 23:14:43 +0100
committerMarcin Kuzminski <marcin@python-works.com>2013-01-21 23:14:43 +0100
commite3e1ee0efc10310b63ca64b60cda093425df1446 (patch)
tree966af15874ffc457afe57ca882e620d92124acbc /rhodecode/model/comment.py
parentc6bf09028ff3caf31a02030a86f63d6ac02e1eaa (diff)
improved extraction of user from changeset when sending notification.
Fallback to repo owner if we cannot get the user --HG-- branch : beta extra : amend_source : d55aa77b41ea3e7b8e5cb8a3a267ca320a1cff1b
Diffstat (limited to 'rhodecode/model/comment.py')
-rw-r--r--rhodecode/model/comment.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/rhodecode/model/comment.py b/rhodecode/model/comment.py
index 6ff96099..c17a55fa 100644
--- a/rhodecode/model/comment.py
+++ b/rhodecode/model/comment.py
@@ -88,7 +88,6 @@ class ChangesetCommentsModel(BaseModel):
if revision:
cs = repo.scm_instance.get_changeset(revision)
desc = "%s - %s" % (cs.short_id, h.shorter(cs.message, 256))
- author_email = cs.author_email
comment.revision = revision
elif pull_request:
pull_request = self.__get_pull_request(pull_request)
@@ -122,7 +121,11 @@ class ChangesetCommentsModel(BaseModel):
# get the current participants of this changeset
recipients = ChangesetComment.get_users(revision=revision)
# add changeset author if it's in rhodecode system
- recipients += [User.get_by_email(author_email)]
+ cs_author = User.get_from_cs_author(cs.author)
+ if not cs_author:
+ #use repo owner if we cannot extract the author correctly
+ cs_author = repo.user
+ recipients += [cs_author]
email_kwargs = {
'status_change': status_change,
}