Skip to content
Open
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
5 changes: 3 additions & 2 deletions serveradmin/serverdb/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ class Meta:

def clean(self):
# It makes no sense to add inet or supernet attributes to hosts of
# ip_addr_type null because they would have to be empty anyways.
# ip_addr_type null because they would have to be empty anyway.
inet_attribute = (
'attribute' in self.cleaned_data and
self.cleaned_data['attribute'].type in ('inet', 'supernet') and
self.instance.servertype.ip_addr_type == 'null'
self.cleaned_data['servertype'].ip_addr_type == 'null'
)
if inet_attribute:
raise ValidationError(
Expand Down
Loading