Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
8d5fc85f
Commit
8d5fc85f
authored
Mar 20, 2017
by
Administrator
Browse files
Don't check network for visible protocol types
/close
#71
parent
2a621570
Changes
2
Hide whitespace changes
Inline
Side-by-side
models/database.py
View file @
8d5fc85f
...
...
@@ -115,10 +115,10 @@ class ProtocolType(DatabaseModel):
]
@
staticmethod
def
get_public_protocoltypes
(
user
):
def
get_public_protocoltypes
(
user
,
check_networks
=
True
):
return
[
protocoltype
for
protocoltype
in
ProtocolType
.
query
.
all
()
if
protocoltype
.
has_public_view_right
(
user
)
if
protocoltype
.
has_public_view_right
(
user
,
check_networks
=
check_networks
)
]
@
staticmethod
...
...
server.py
View file @
8d5fc85f
...
...
@@ -357,7 +357,7 @@ def list_protocols():
except
(
ValueError
,
TypeError
):
pass
search_term
=
request
.
args
.
get
(
"search"
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
,
check_networks
=
False
)
search_form
=
ProtocolSearchForm
(
protocoltypes
)
if
protocoltype_id
is
not
None
:
search_form
.
protocoltype_id
.
data
=
protocoltype_id
...
...
@@ -950,7 +950,7 @@ def list_decisions():
except
(
ValueError
,
TypeError
):
pass
search_term
=
request
.
args
.
get
(
"search"
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
,
check_networks
=
False
)
decisioncategories
=
[
category
for
protocoltype
in
protocoltypes
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment