Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions jms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ def system_users_name_list(self):
def protocols_name(self):
names = []
for protocol in self.protocols:
names.append(protocol['name'])
_name, port = protocol.split('/')
names.append(_name)
return names

def has_protocol(self, name):
return name in self.protocols_name

def get_port_by_name(self, name):
for protocol in self.protocols:
if protocol['name'].lower() == name:
return protocol['port']
_name, port = protocol.split('/')
if _name.lower() == name:
return port
return None

@property
Expand Down