From d863305b944c13e89cd6a76f67ce54159f984b10 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 8 Oct 2017 12:44:04 +0200 Subject: [PATCH] fix check for adapter in 'externalIdentifier' --- integrator/source.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/integrator/source.py b/integrator/source.py index 8c0773f..74bcfb1 100644 --- a/integrator/source.py +++ b/integrator/source.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# Copyright (c) 2017 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ from zope import interface, component from zope.interface import implements from zope.component import adapts -from loops.common import adapted +from loops.common import adapted, AdapterBase from loops.interfaces import ILoopsObject from loops.integrator.interfaces import IExternalSourceInfo @@ -39,6 +39,7 @@ class ExternalSourceInfo(object): adapts(ILoopsObject) def __init__(self, context): + #import pdb; pdb.set_trace() self.context = self.__parent__ = context def getSourceInfo(self): @@ -47,7 +48,9 @@ class ExternalSourceInfo(object): def getExternalIdentifier(self): # first try to find adapter on adapted concept or resource adobj = adapted(self.context) - if adobj != self.context: + #if adobj != self.context: + #if not adobj is self.context: + if isinstance(adobj, AdapterBase): adaptedSourceInfo = IExternalSourceInfo(adobj, None) if adaptedSourceInfo is not None: return adaptedSourceInfo.externalIdentifier