diff --git a/app/routers/dependencies_v3.py b/app/routers/dependencies_v3.py index 2e5b9d1..baeaaa6 100644 --- a/app/routers/dependencies_v3.py +++ b/app/routers/dependencies_v3.py @@ -34,7 +34,10 @@ def get_account_context_optional( # This identifies the script/app, regardless of the user/account context. if x_aether_api_key: sql = "SELECT * FROM api_key WHERE (public_key = :key OR secret_key = :key) LIMIT 1" - if api_key_rec := sql_select(sql=sql, data={'key': x_aether_api_key}): + if api_key_results := sql_select(sql=sql, data={'key': x_aether_api_key}): + # sql_select returns a list when raw SQL is used + api_key_rec = api_key_results[0] if isinstance(api_key_results, list) else api_key_results + if api_key_rec.get('enable'): now = datetime.now() enable_from = api_key_rec.get('enable_from')