Commit a1c3aaf4 authored by Vincent Pelletier's avatar Vincent Pelletier

Honor alarm_notification_mode property value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20192 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b980fcb4
......@@ -430,14 +430,19 @@ class Alarm(XMLObject, PeriodicityMixin):
to the system address if nothing was defined or to
notify all agents defined on the alarm if specified.
"""
notification_tool = getToolByName(self, 'portal_notifications')
candidate_list = self.getDestinationValueList()
if not candidate_list:
candidate_list = None
notification_mode = self.getAlarmNotificationMode()
if notification_mode == 'never':
return
if self.sense():
prefix = 'ERROR'
else:
if notification_mode != 'always'
return
prefix = 'INFO'
notification_tool = getToolByName(self, 'portal_notifications')
candidate_list = self.getDestinationValueList()
if not candidate_list:
candidate_list = None
notification_tool.sendMessage(recipient=candidate_list,
subject='[%s] ERP5 Alarm Notification: %s' %
(prefix, self.getTitle()),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment