Skip to content
Snippets Groups Projects
Commit bd7a594e authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Účastníkům při výběru školy nezobrazujeme skrytá místa

Closes #253
parent a7dda4db
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ def api_find_town(): ...@@ -27,6 +27,7 @@ def api_find_town():
places = (db.get_session().query(db.Place) places = (db.get_session().query(db.Place)
.filter_by(level=3) .filter_by(level=3)
.filter(func.lower(db.f_unaccent(db.Place.name)).like(func.lower(db.f_unaccent(query + '%')))) .filter(func.lower(db.f_unaccent(db.Place.name)).like(func.lower(db.f_unaccent(query + '%'))))
.filter(db.Place.hidden == False)
.options(joinedload(db.Place.parent_place)) .options(joinedload(db.Place.parent_place))
.order_by(db.Place.name, db.Place.place_id) .order_by(db.Place.name, db.Place.place_id)
.limit(max_places) .limit(max_places)
...@@ -59,6 +60,7 @@ def api_get_schools(): ...@@ -59,6 +60,7 @@ def api_get_schools():
places = (db.get_session().query(db.Place) places = (db.get_session().query(db.Place)
.filter_by(level=4, type=db.PlaceType.school, parent=town_id) .filter_by(level=4, type=db.PlaceType.school, parent=town_id)
.options(joinedload(db.Place.school)) .options(joinedload(db.Place.school))
.filter(db.Place.hidden == False)
.order_by(db.Place.name) .order_by(db.Place.name)
.all()) .all())
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment