fix initid monkey patch

This commit is contained in:
Helmut Merz 2017-01-12 10:15:31 +01:00
parent 421c21cdec
commit b3677ea635

View file

@ -2,15 +2,16 @@
# intid monkey patch for avoiding ForbiddenAttribute error
from zope import component
from zope.intid.interfaces import IIntIds
from zope import intid
from zope.security.proxy import removeSecurityProxy
class IntIds(intid.IntIds):
def queryId(self, ob, default=None):
try:
return self.getId(removeSecurityProxy(ob))
except KeyError:
return default
def queryId(self, ob, default=None):
try:
return self.getId(removeSecurityProxy(ob))
except KeyError:
return default
intid.IntIds.queryId = queryId
intid.IntIds = IntIds