From b3677ea635e966c4c7dd998f0515c31656dec6c1 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 12 Jan 2017 10:15:31 +0100 Subject: [PATCH] fix initid monkey patch --- __init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index c431dc6..5d2b421 100644 --- a/__init__.py +++ b/__init__.py @@ -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