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 | ||||
| 
 | ||||
| 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 | ||||
| 
 | ||||
| intid.IntIds = IntIds | ||||
| intid.IntIds.queryId = queryId | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue