|
a/Allura/allura/model/notification.py |
|
b/Allura/allura/model/notification.py |
|
... |
|
... |
154 |
d['text'] = ''
|
154 |
d['text'] = ''
|
155 |
try:
|
155 |
try:
|
156 |
''' Add addional text to the notification e-mail based on the artifact type '''
|
156 |
''' Add addional text to the notification e-mail based on the artifact type '''
|
157 |
template = cls.view.get_template('mail/' + artifact.type_s + '.txt')
|
157 |
template = cls.view.get_template('mail/' + artifact.type_s + '.txt')
|
158 |
d['text'] += template.render(dict(c=c, g=g, config=config, data=artifact))
|
158 |
d['text'] += template.render(dict(c=c, g=g, config=config, data=artifact))
|
159 |
except Exception, e:
|
159 |
except jinja2.TemplateNotFound:
|
|
|
160 |
pass
|
|
|
161 |
except:
|
160 |
''' Catch any errors loading or rendering the template,
|
162 |
''' Catch any errors loading or rendering the template,
|
161 |
but the notification still gets sent if there is an error
|
163 |
but the notification still gets sent if there is an error
|
162 |
'''
|
164 |
'''
|
163 |
log.debug('Error rendering notification template %s: %s' % (artifact.type_s, e))
|
165 |
log.warn('Could not render notification template %s' % artifact.type_s, exc_info=True)
|
164 |
|
166 |
|
165 |
assert d['reply_to_address'] is not None
|
167 |
assert d['reply_to_address'] is not None
|
166 |
project = Project.query.get(_id=d.get('project_id', c.project._id))
|
168 |
project = Project.query.get(_id=d.get('project_id', c.project._id))
|
167 |
if project.notifications_disabled:
|
169 |
if project.notifications_disabled:
|
168 |
log.info('Notifications disabled for project %s, not sending %s(%r)',
|
170 |
log.info('Notifications disabled for project %s, not sending %s(%r)',
|