From 425edeed3f810c4c310d70228f1dfc7136a2e4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Tue, 9 Jul 2024 04:15:23 +0200 Subject: [PATCH] Cleanup --- src/senaite/referral/adapters/idserver.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/senaite/referral/adapters/idserver.py b/src/senaite/referral/adapters/idserver.py index 937eb19..fcf9a72 100644 --- a/src/senaite/referral/adapters/idserver.py +++ b/src/senaite/referral/adapters/idserver.py @@ -77,10 +77,13 @@ def __init__(self, context): self.context = context def has_custom_type_registered(self): - # get the ID formatting config - config_map = api.get_bika_setup().getIDFormatting() - for config in config_map: - portal_type = config["portal_type"] + """Returns whether an entry for AnalysisRequestFromShipment portal + type exists in ID server formatting config + """ + bs = api.get_bika_setup() + formatting = bs.getIDFormatting() + for config in formatting: + portal_type = config.get("portal_type", "") if portal_type.lower() == SAMPLE_FROM_SHIPMENT_ID.lower(): return True return False