From 33568d431fd4296fdbfcfa1da07c62b29fddb526 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 4 Sep 2024 13:19:50 -0700 Subject: [PATCH] change TypeError test --- app/authentication/auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/authentication/auth.py b/app/authentication/auth.py index 5dbf7e047..2b9b02b0f 100644 --- a/app/authentication/auth.py +++ b/app/authentication/auth.py @@ -67,8 +67,10 @@ def requires_internal_auth(expected_client_id): f"TODO REMOVE: Enter requires_internal_auth with expected client id {expected_client_id}" ) # Looks like we are hitting this for some reason - if expected_client_id not in current_app.config.get("INTERNAL_CLIENT_API_KEYS"): - keys = current_app.config.get("INTERNAL_CLIENT_API_KEYS") + # expected_client_id looks like ADMIN_CLIENT_USERNAME on the admin side, and + # INTERNAL_CLIENT_API_KEYS is a dict + keys = current_app.config.get("INTERNAL_CLIENT_API_KEYS") + if keys.get(expected_client_id) is None: debug_not_production( f"TODO REMOVE: {expected_client_id} not in {keys}, raising TypeError\n" )