Commit 8d5fc85f authored by Administrator's avatar Administrator
Browse files

Don't check network for visible protocol types

/close #71
parent 2a621570
...@@ -115,10 +115,10 @@ class ProtocolType(DatabaseModel): ...@@ -115,10 +115,10 @@ class ProtocolType(DatabaseModel):
] ]
@staticmethod @staticmethod
def get_public_protocoltypes(user): def get_public_protocoltypes(user, check_networks=True):
return [ return [
protocoltype for protocoltype in ProtocolType.query.all() 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 @staticmethod
......
...@@ -357,7 +357,7 @@ def list_protocols(): ...@@ -357,7 +357,7 @@ def list_protocols():
except (ValueError, TypeError): except (ValueError, TypeError):
pass pass
search_term = request.args.get("search") 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) search_form = ProtocolSearchForm(protocoltypes)
if protocoltype_id is not None: if protocoltype_id is not None:
search_form.protocoltype_id.data = protocoltype_id search_form.protocoltype_id.data = protocoltype_id
...@@ -950,7 +950,7 @@ def list_decisions(): ...@@ -950,7 +950,7 @@ def list_decisions():
except (ValueError, TypeError): except (ValueError, TypeError):
pass pass
search_term = request.args.get("search") search_term = request.args.get("search")
protocoltypes = ProtocolType.get_public_protocoltypes(user) protocoltypes = ProtocolType.get_public_protocoltypes(user, check_networks=False)
decisioncategories = [ decisioncategories = [
category category
for protocoltype in protocoltypes 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