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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jul 15 12:17:09 CEST 2008


Author: vincent
Date: Tue Jul 15 12:17:08 2008
New Revision: 22471

URL: http://svn.erp5.org?rev=22471&view=rev
Log:
Make "notify" only use most recent (considered incomplete) alarm result if it is started as an activity, so it can also be invoked by hand to generate a result of a completed alarm run.

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=22471&r1=22470&r2=22471&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Alarm.py (original)
+++ erp5/trunk/products/ERP5/Document/Alarm.py Tue Jul 15 12:17:08 2008
@@ -317,7 +317,7 @@
         # Old API
         getattr(self.activate(tag=tag), method_id)()
       if self.isAlarmNotificationMode():
-        self.activate(after_tag=tag).notify()
+        self.activate(after_tag=tag).notify(include_active=True)
 
   security.declareProtected(Permissions.ModifyPortalContent, 'sense')
   def sense(self, process=None):
@@ -424,7 +424,7 @@
     return self.activeSense(fixit=1)
 
   security.declareProtected(Permissions.ModifyPortalContent, 'notify')
-  def notify(self):
+  def notify(self, include_active=False):
     """
     This method is called to notify people that some alarm has
     been sensed. Notification consists of sending an email
@@ -436,7 +436,7 @@
       return
     # Grab real latest result. Otherwise, we would check n-1 execution as n is
     # still considered running, and its result would be skipped.
-    active_process = self.getLastActiveProcess(include_active=True)
+    active_process = self.getLastActiveProcess(include_active=include_active)
     if self.sense(process=active_process):
       prefix = 'ERROR'
     else:




More information about the Erp5-report mailing list