Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
83468d05
Commit
83468d05
authored
4 years ago
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
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
!23
Titulky stránek a drobečková navigace
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/org_place.py
+3
-3
3 additions, 3 deletions
mo/web/org_place.py
with
3 additions
and
3 deletions
mo/web/org_place.py
+
3
−
3
View file @
83468d05
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment