From 601058fc5e8cb008ac8dfd926fbdc9c44bb9b464 Mon Sep 17 00:00:00 2001 From: guille Date: Fri, 17 Nov 2023 08:16:19 +0100 Subject: [PATCH] Bug fix in persistence CityObject --- hub/persistence/repositories/city_object.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hub/persistence/repositories/city_object.py b/hub/persistence/repositories/city_object.py index 5c805d15..3fd5c62c 100644 --- a/hub/persistence/repositories/city_object.py +++ b/hub/persistence/repositories/city_object.py @@ -142,12 +142,12 @@ class CityObject(Repository): try: # search by name first with Session(self.engine) as session: - city_object = session.execute(select(Model).where(Model.name == name, Model.city_id in city_ids)).first() + city_object = session.execute(select(Model).where(Model.name == name, Model.city_id.in_(tuple(city_ids)))).first() if city_object is not None: return city_object[0] # name not found, so search by alias instead city_objects = session.execute( - select(Model).where(Model.aliases.contains(name), Model.city_id in city_ids) + select(Model).where(Model.aliases.contains(name), Model.city_id.in_(tuple(city_ids))) ).all() for city_object in city_objects: aliases = city_object[0].aliases.replace('{', '').replace('}', '').split(',')