Commit 3b71aa29 by Czémán Arnold

firewall: fix type selector in rules editor

parent 8ddf8f87
...@@ -157,6 +157,10 @@ class Rule(models.Model): ...@@ -157,6 +157,10 @@ class Rule(models.Model):
selected_fields = [field for field in fields if field] selected_fields = [field for field in fields if field]
if len(selected_fields) > 1: if len(selected_fields) > 1:
raise ValidationError(_('Only one field can be selected.')) raise ValidationError(_('Only one field can be selected.'))
elif len(selected_fields) < 1:
raise ValidationError(
_('One of the following fields must be selected: '
'vlan, vlan group, host, host group, firewall.'))
def get_external_ipv4(self): def get_external_ipv4(self):
return (self.nat_external_ipv4 return (self.nat_external_ipv4
......
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