Commit a42666e0 by Bach Dániel

firewall: fix queryset in list_ports()

parent 071afcdd
...@@ -742,7 +742,7 @@ class Host(models.Model): ...@@ -742,7 +742,7 @@ class Host(models.Model):
Return a list of ports with forwarding rules set. Return a list of ports with forwarding rules set.
""" """
retval = [] retval = []
for rule in self.rules.all(): for rule in self.rules.filter(dport__isnull=False, direction='in'):
forward = { forward = {
'proto': rule.proto, 'proto': rule.proto,
'private': rule.dport, 'private': rule.dport,
......
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 sign in to comment