Skip to content
Snippets Groups Projects
Commit 83468d05 authored by Jiří Setnička's avatar Jiří Setnička
Browse files

Místa: Na předky se vždy ptáme gatekeepera, který cachuje

parent fa096447
No related branches found
No related tags found
1 merge request!23Titulky stránek a drobečková navigace
......@@ -71,7 +71,7 @@ class PlaceSchoolEditForm(PlaceEditForm):
def place_breadcrumbs(place: db.Place, action: Optional[str] = None) -> str:
elements = []
parents: List[db.Place] = reversed(db.get_place_parents(place))
parents: List[db.Place] = reversed(g.gatekeeper.get_parents(place))
for parent in parents:
elements.append((url_for('org_place', id=parent.place_id), parent.name))
if action:
......@@ -205,7 +205,7 @@ def org_place_move(id: int):
if not new_parent:
search_error = 'Místo s tímto kódem se nepovedlo nalézt'
else:
new_parents = reversed(db.get_place_parents(new_parent))
new_parents = reversed(g.gatekeeper.get_parents(new_parent))
(_, levels) = db.place_type_names_and_levels[place.type]
rr = g.gatekeeper.rights_for(new_parent)
......@@ -358,7 +358,7 @@ def org_place_rights(id: int):
if not place:
raise werkzeug.exceptions.NotFound()
parent_ids = [p.place_id for p in db.get_place_parents(place)]
parent_ids = [p.place_id for p in g.gatekeeper.get_parents(place)]
roles = (sess.query(db.UserRole)
.filter(db.UserRole.place_id.in_(parent_ids))
.options(joinedload(db.UserRole.user))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment