##// END OF EJS Templates
emailing: log failing emailing as an error...
Mads Kiilerich -
r3781:40d50bb7 beta
parent child Browse files
Show More
@@ -85,6 +85,9 b' class NotificationModel(BaseModel):'
85 85 obj = self._get_user(u)
86 86 if obj:
87 87 recipients_objs.append(obj)
88 else:
89 # TODO: inform user that requested operation couldn't be completed
90 log.error('cannot email unknown user %r', u)
88 91 recipients_objs = set(recipients_objs)
89 92 log.debug('sending notifications %s to %s' % (
90 93 type_, recipients_objs)
@@ -95,6 +98,7 b' class NotificationModel(BaseModel):'
95 98 log.debug('sending notifications %s to admins: %s' % (
96 99 type_, recipients_objs)
97 100 )
101 # TODO: inform user who are notified
98 102 notif = Notification.create(
99 103 created_by=created_by_obj, subject=subject,
100 104 body=body, recipients=recipients_objs, type_=type_
@@ -89,8 +89,6 b' class PullRequestModel(BaseModel):'
89 89 revision_data = [(x.raw_id, x.message)
90 90 for x in map(org_repo.get_changeset, revisions)]
91 91 #notification to reviewers
92 notif = NotificationModel()
93
94 92 pr_url = h.url('pullrequest_show', repo_name=other_repo.repo_name,
95 93 pull_request_id=new.pull_request_id,
96 94 qualified=True,
@@ -114,7 +112,7 b' class PullRequestModel(BaseModel):'
114 112 'pr_revisions': revision_data
115 113 }
116 114
117 notif.create(created_by=created_by_user, subject=subject, body=body,
115 NotificationModel().create(created_by=created_by_user, subject=subject, body=body,
118 116 recipients=reviewers,
119 117 type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
120 118 return new
General Comments 0
You need to be logged in to leave comments. Login now