From c2d483b1b24de882c457b0063ca85344a8920d79 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Mon, 30 Oct 2023 12:38:03 -0700 Subject: [PATCH] Add bunch of logging to get_activity --- app/api/v1/activities.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/api/v1/activities.py b/app/api/v1/activities.py index 82bcd79..93e2f40 100644 --- a/app/api/v1/activities.py +++ b/app/api/v1/activities.py @@ -96,10 +96,17 @@ async def get_activity( ) return schemas.ActivitiesResponse() + logger.warning(f"Got {len(activities)} activities from activities table.") activities_with_cw: List[schemas.ActivityWithCW] = [] for activity in activities: - unit: Dict = units.get(activity.asset_id).copy() + logger.warning(f"Checking activity: {activity}") + unit = units.get(activity.asset_id) + if unit is None: + continue + unit = unit.copy() + logger.warning(f"Found matching unit: {unit}") token = unit.pop("token", None) + logger.warning(f"Got token: {token}") org = unit.pop("organization", None) project = unit.pop("project", None)