Bug fix in persistence CityObject
This commit is contained in:
parent
5fa55ea79f
commit
601058fc5e
|
@ -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(',')
|
||||
|
|
Loading…
Reference in New Issue
Block a user