From 7c62d93327626910e52871992a6370136e923e50 Mon Sep 17 00:00:00 2001 From: Daisie Huang Date: Thu, 21 Nov 2024 14:47:11 -0800 Subject: [PATCH] list_programs has a tuple return --- ingest_operations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ingest_operations.py b/ingest_operations.py index cbd3897..65dd862 100644 --- a/ingest_operations.py +++ b/ingest_operations.py @@ -384,7 +384,9 @@ def authorize_program_for_user(user_id): return response, status_code # we need to check to see if the program even exists in the system - all_programs = auth.list_programs_in_opa(token) + all_programs, status_code = auth.list_programs_in_opa(token) + if status_code != 200: + return all_programs, status_code if program_dict["program_id"] not in all_programs: return {"error": f"Program {program_dict['program_id']} does not exist in {all_programs}"} response["programs"][program_dict["program_id"]] = program_dict