Commit 5404964a authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_maileva_connector: Ensure it we dont have duplicated connectors

parent 6620d328
maileva_connector = context.portal_catalog.getResultValue(
maileva_connector_list = context.portal_catalog(
portal_type='Maileva SOAP Connector',
reference=reference,
validation_state='validated')
if not maileva_connector:
raise ValueError('Maileav soap connector is not defined')
return maileva_connector
validation_state='validated',
limit=2)
# Ensure there is no duplication.
if not len(maileva_connector_list):
raise ValueError('Maileva soap connector is not defined')
elif len(maileva_connector_list) != 1:
raise ValueError('More them one Maileva soap connector was found!')
return maileva_connector_list[0]
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