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 # intid monkey patch for avoiding ForbiddenAttribute error
from zope import component
from zope.intid.interfaces import IIntIds
from zope import intid from zope import intid
from zope.security.proxy import removeSecurityProxy from zope.security.proxy import removeSecurityProxy
class IntIds(intid.IntIds): def queryId(self, ob, default=None):
def queryId(self, ob, default=None):
try: try:
return self.getId(removeSecurityProxy(ob)) return self.getId(removeSecurityProxy(ob))
except KeyError: except KeyError:
return default return default
intid.IntIds = IntIds intid.IntIds.queryId = queryId