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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 8 18:55:38 CET 2010


Author: jm
Date: Fri Jan  8 18:55:37 2010
New Revision: 31668

URL: http://svn.erp5.org?rev=31668&view=rev
Log:
Fix detection of parameters of alarm scripts

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=31668&r1=31667&r2=31668&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Alarm.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Alarm.py [utf8] Fri Jan  8 18:55:37 2010
@@ -304,11 +304,9 @@
         # We do some inspection to keep compatibility
         # (because fixit and tag were not set previously)
         tag = str(self.portal_ids.generateNewLengthId(id_group=self.getId()))
-        kw = {}
-        method = getattr(self, method_id)
-        name_list = method.func_code.co_varnames
-        if 'params' in name_list or (method.func_defaults is not None
-          and len(method.func_defaults) < len(name_list)):
+        func_code = getattr(self, method_id).func_code
+        name_list = func_code.co_varnames[:func_code.co_argcount]
+        if 'params' in name_list:
           # New New API
           getattr(self.activate(tag=tag), method_id)(fixit=fixit, tag=tag, params=params)
         elif 'fixit' in name_list:




More information about the Erp5-report mailing list