Skip to content

Commit

Permalink
Ensure place/prj ID is int when query is a list.
Browse files Browse the repository at this point in the history
  • Loading branch information
synrg committed Mar 13, 2024
1 parent a7a0201 commit 00ce313
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inatcog/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 00ce313

Please sign in to comment.