From e81dbbc39c8a6ab5ed549bf74cc2bdc4a557a9ad Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Wed, 28 Feb 2024 11:04:21 +0100 Subject: [PATCH] [#4] Fix KeyError in authenticate_agency --- amarillo/services/oauth2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amarillo/services/oauth2.py b/amarillo/services/oauth2.py index 679722f..f7c85b0 100644 --- a/amarillo/services/oauth2.py +++ b/amarillo/services/oauth2.py @@ -40,7 +40,7 @@ async def verify_optional_api_key(X_API_Key: Optional[str] = Header(None)): def authenticate_agency(agency_id: str, password: str): agency_conf_service : AgencyConfService = container['agencyconf'] - agency_conf = agency_conf_service.agency_id_to_agency_conf[agency_id] + agency_conf = agency_conf_service.agency_id_to_agency_conf.get(agency_id, None) if not agency_conf: return False