[Erp5-report] r20192 - /erp5/trunk/products/ERP5/Document/Alarm.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 28 12:36:41 CET 2008


Author: vincent
Date: Fri Mar 28 12:36:38 2008
New Revision: 20192

URL: http://svn.erp5.org?rev=20192&view=rev
Log:
Honor alarm_notification_mode property value.

Modified:
    erp5/trunk/products/ERP5/Document/Alarm.py

Modified: erp5/trunk/products/ERP5/Document/Alarm.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Alarm.py?rev=20192&r1=20191&r2=20192&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Alarm.py (original)
+++ erp5/trunk/products/ERP5/Document/Alarm.py Fri Mar 28 12:36:38 2008
@@ -430,14 +430,19 @@
     to the system address if nothing was defined or to 
     notify all agents defined on the alarm if specified.
     """
+    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
-    if self.sense():
-      prefix = 'ERROR'
-    else:
-      prefix = 'INFO'
     notification_tool.sendMessage(recipient=candidate_list, 
                 subject='[%s] ERP5 Alarm Notification: %s' %
                   (prefix, self.getTitle()),




More information about the Erp5-report mailing list