Commit 8d5fc85f authored by Administrator's avatar Administrator

Don't check network for visible protocol types

/close #71
parent 2a621570
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment