Commit f9b251b5 authored by Titouan Soulard's avatar Titouan Soulard

erp5_jio_connector: ensure that Portal Types are defined before filtering

parent aacf0773
Pipeline #36947 passed with stage
...@@ -97,20 +97,21 @@ class JioApiConnector(XMLObject): ...@@ -97,20 +97,21 @@ class JioApiConnector(XMLObject):
""" """
if portal_type: if portal_type:
return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \ return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \
if tester.isMatchingProvider() and portal_type in tester.getPortalTypeFilterList()] if tester.isMatchingProvider() and tester.getPortalTypeFilterList() and portal_type in tester.getPortalTypeFilterList()]
else: else:
return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") if tester.isMatchingProvider()] return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \
if tester.isMatchingProvider() and tester.getPortalTypeFilterList() is None]
def getCheckingTesterList(self, portal_type): def getCheckingTesterList(self, portal_type):
""" """
Returns list of checking providers for a given Portal Type. Returns list of checking providers for a given Portal Type.
""" """
return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \ return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \
if tester.isCheckingProvider() and portal_type in tester.getPortalTypeFilterList()] if tester.isCheckingProvider() and tester.getPortalTypeFilterList() and portal_type in tester.getPortalTypeFilterList()]
def getUpdatingTesterList(self, portal_type): def getUpdatingTesterList(self, portal_type):
""" """
Returns list of updating providers for a given Portal Type. Returns list of updating providers for a given Portal Type.
""" """
return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \ return [tester for tester in self.objectValues(portal_type="jIO API Equality Tester") \
if tester.isUpdatingProvider() and portal_type in tester.getPortalTypeFilterList()] if tester.isUpdatingProvider() and tester.getPortalTypeFilterList() and portal_type in tester.getPortalTypeFilterList()]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment