From 00ce313a005a1f7348bba7e091b3fe764bbe92f7 Mon Sep 17 00:00:00 2001 From: Ben Armstrong Date: Wed, 13 Mar 2024 17:24:16 -0300 Subject: [PATCH] Ensure place/prj ID is int when query is a list. --- inatcog/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inatcog/api.py b/inatcog/api.py index 0159c7a..3f06bd6 100644 --- a/inatcog/api.py +++ b/inatcog/api.py @@ -189,9 +189,9 @@ async def get_places( if isinstance(query, list): return { - place_id: self.places_cache[place_id] + place_id: self.places_cache[int(place_id)] for place_id in query - if place_id in self.places_cache + if int(place_id) in self.places_cache } if first_place_id in self.places_cache: return self.places_cache[first_place_id] @@ -235,9 +235,9 @@ async def get_projects( if isinstance(query, list): return { - project_id: self.projects_cache[project_id] + project_id: self.projects_cache[int(project_id)] for project_id in query - if self.projects_cache[project_id] + if self.projects_cache.get(int(project_id)) } if first_project_id in self.projects_cache: return self.projects_cache[first_project_id]