Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
926e2e7e
Commit
926e2e7e
authored
Mar 11, 2018
by
Robin Sonnabend
Browse files
Also show public documents to privileged users
parent
19a1733e
Changes
1
Hide whitespace changes
Inline
Side-by-side
models/database.py
View file @
926e2e7e
...
...
@@ -376,7 +376,6 @@ class Protocol(DatabaseModel):
candidates
=
[
document
for
document
in
self
.
documents
if
document
.
is_compiled
and
(
private
is
None
or
document
.
is_private
==
private
)
]
private_candidates
=
[
document
for
document
in
candidates
...
...
@@ -386,10 +385,14 @@ class Protocol(DatabaseModel):
document
for
document
in
candidates
if
not
document
.
is_private
]
if
len
(
private_candidates
)
>
0
:
return
private_candidates
[
0
]
elif
len
(
public_candidates
)
>
0
:
return
public_candidates
[
0
]
def
_get_candidates
():
if
private
is
None
or
private
:
return
private_candidates
+
public_candidates
return
public_candidates
candidates
=
_get_candidates
()
if
candidates
:
return
candidates
[
0
]
return
None
def
get_template
(
self
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment