Show More
@@ -67,7 +67,7 b' class ChangesetCommentsModel(BaseModel):' | |||||
67 | repo = Repository.get(repo_id) |
|
67 | repo = Repository.get(repo_id) | |
68 | cs = repo.scm_instance.get_changeset(revision) |
|
68 | cs = repo.scm_instance.get_changeset(revision) | |
69 | desc = cs.message |
|
69 | desc = cs.message | |
70 | author = cs.author_email |
|
70 | author_email = cs.author_email | |
71 | comment = ChangesetComment() |
|
71 | comment = ChangesetComment() | |
72 | comment.repo = repo |
|
72 | comment.repo = repo | |
73 | comment.user_id = user_id |
|
73 | comment.user_id = user_id | |
@@ -96,8 +96,8 b' class ChangesetCommentsModel(BaseModel):' | |||||
96 | # get the current participants of this changeset |
|
96 | # get the current participants of this changeset | |
97 | recipients = ChangesetComment.get_users(revision=revision) |
|
97 | recipients = ChangesetComment.get_users(revision=revision) | |
98 |
|
98 | |||
99 | # add changeset author |
|
99 | # add changeset author if it's in rhodecode system | |
100 | recipients += [User.get_by_email(author)] |
|
100 | recipients += [User.get_by_email(author_email)] | |
101 |
|
101 | |||
102 | NotificationModel().create( |
|
102 | NotificationModel().create( | |
103 | created_by=user_id, subject=subj, body=body, |
|
103 | created_by=user_id, subject=subj, body=body, |
@@ -169,10 +169,12 b' class NotificationModel(BaseModel):' | |||||
169 | of notification object |
|
169 | of notification object | |
170 | """ |
|
170 | """ | |
171 |
|
171 | |||
172 | _map = {notification.TYPE_CHANGESET_COMMENT:_('commented on commit'), |
|
172 | _map = { | |
|
173 | notification.TYPE_CHANGESET_COMMENT: _('commented on commit'), | |||
173 |
|
|
174 | notification.TYPE_MESSAGE: _('sent message'), | |
174 |
|
|
175 | notification.TYPE_MENTION: _('mentioned you'), | |
175 |
|
|
176 | notification.TYPE_REGISTRATION: _('registered in RhodeCode') | |
|
177 | } | |||
176 |
|
178 | |||
177 | DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S" |
|
179 | DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S" | |
178 |
|
180 | |||
@@ -182,9 +184,10 b' class NotificationModel(BaseModel):' | |||||
182 | else: |
|
184 | else: | |
183 | DTF = lambda d: datetime.datetime.strftime(d, DATETIME_FORMAT) |
|
185 | DTF = lambda d: datetime.datetime.strftime(d, DATETIME_FORMAT) | |
184 | when = DTF(notification.created_on) |
|
186 | when = DTF(notification.created_on) | |
185 | data = dict(user=notification.created_by_user.username, |
|
187 | data = dict( | |
186 | action=_map[notification.type_], |
|
188 | user=notification.created_by_user.username, | |
187 | when=when) |
|
189 | action=_map[notification.type_], when=when, | |
|
190 | ) | |||
188 | return tmpl % data |
|
191 | return tmpl % data | |
189 |
|
192 | |||
190 |
|
193 |
General Comments 0
You need to be logged in to leave comments.
Login now