Commit 6fac88fe authored by Jérome Perrin's avatar Jérome Perrin

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.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7377aa5
...@@ -2443,11 +2443,11 @@ class Base( CopyContainer, ...@@ -2443,11 +2443,11 @@ class Base( CopyContainer,
return self.getId() return self.getId()
# This method allows to sort objects in list is a more reasonable way # 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): def getIntId(self):
try: try:
return int(self.getId()) return int(self.getId())
except TypeError: except ValueError:
return None return None
# Default views - the default security in CMFCore # Default views - the default security in CMFCore
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment