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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jun 16 09:56:06 CEST 2006


Author: aurel
Date: Fri Jun 16 09:56:04 2006
New Revision: 7804

URL: http://svn.erp5.org?rev=7804&view=rev
Log:
if no report method defined, don't fail

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=7804&r1=7803&r2=7804&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Alarm.py (original)
+++ erp5/trunk/products/ERP5/Document/Alarm.py Fri Jun 16 09:56:04 2006
@@ -88,7 +88,7 @@
       activity. We don't care about the response, we just want to start
       some calculations. Results should be read with the method 'sense'
       later.
-      
+
       """
       # Set the new date
       LOG('activeSense, self.getPath()',0,self.getPath())
@@ -106,8 +106,8 @@
     def sense(self):
       """
       This method returns True or False. False for no problem, True for problem.
-      
-      This method should respond quickly.  Basically the response depends on some 
+
+      This method should respond quickly.  Basically the response depends on some
       previous calculation made by activeSense.
       """
       method_id = self.getSenseMethodId()
@@ -131,13 +131,15 @@
     security.declareProtected(Permissions.View, 'report')
     def report(self,process=None):
       """
-      This methods produces a report (HTML) 
+      This methods produces a report (HTML)
       This generate the output of the results. It can be used to nicely
       explain the problem. We don't do calculation at this time, it should
       be made by activeSense.
       """
-      method_id = self.getReportMethodId()
-      LOG('Alarm.report, method_id',0,method_id)
+      method_id = self.getReportMethodId(None)
+      #LOG('Alarm.report, method_id',0,method_id)
+      if method_id is None:
+          return ''
       method = getattr(self,method_id)
       process = self.getCurrentActiveProcess()
       if process is None:
@@ -150,7 +152,7 @@
     def solve(self):
       """
       This method tries solves the problem detected by sense.
-      
+
       This solve the problem if there is a problem detected by sense. If
       no problems, then nothing to do here.
       """
@@ -159,9 +161,9 @@
     security.declareProtected(Permissions.ModifyPortalContent, 'notify')
     def _notify(self):
       """
-      This method is called to notify people that some alarm has 
+      This method is called to notify people that some alarm has
       been sensed.
-      
+
       for example we can send email.
 
       We define nothing here, because we will use an interaction workflow.




More information about the Erp5-report mailing list