[Erp5-report] r18828 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 22 16:54:48 CET 2008


Author: jerome
Date: Tue Jan 22 16:54:48 2008
New Revision: 18828

URL: http://svn.erp5.org?rev=18828&view=rev
Log:
fix exception type in getIntId: int('random string') raises a ValueError, not a
TypeError. 
At the same time, fix permission, it should be Access, not View.


Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=18828&r1=18827&r2=18828&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Tue Jan 22 16:54:48 2008
@@ -2443,11 +2443,11 @@
     return self.getId()
   
   # This method allows to sort objects in list is a more reasonable way
-  security.declareProtected(Permissions.View, 'getIntId')
+  security.declareProtected(Permissions.AccessContentsInformation, 'getIntId')
   def getIntId(self):
     try:
       return int(self.getId())
-    except TypeError:
+    except ValueError:
       return None
 
   # Default views - the default security in CMFCore




More information about the Erp5-report mailing list