fix initid monkey patch
This commit is contained in:
parent
421c21cdec
commit
b3677ea635
1 changed files with 8 additions and 7 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue