We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14561cd commit 986574fCopy full SHA for 986574f
serveradmin/serverdb/forms.py
@@ -41,10 +41,10 @@ class Meta:
41
fields = '__all__'
42
43
def clean(self):
44
- if self.cleaned_data['type'] != 'relation' and self.cleaned_data['target_servertype'] is not None:
+ if self.cleaned_data.get('type') != 'relation' and self.cleaned_data.get('target_servertype') is not None:
45
raise ValidationError('Attribute type must be relation when target servertype is selected!')
46
47
- if self.cleaned_data['type'] == 'inet' and self.cleaned_data['multi'] is True:
+ if self.cleaned_data.get('type') == 'inet' and self.cleaned_data.get('multi') is True:
48
raise ValidationError('Multi attributes of type inet are not supported!')
49
50
super().clean()
0 commit comments