editor form should not require a data field lol
This commit is contained in:
parent
a74efc3706
commit
6fb749ea89
1 changed files with 9 additions and 8 deletions
|
@ -318,14 +318,15 @@ class EditorFormBase(I18nModelFormMixin, ModelForm):
|
||||||
if not self.cleaned_data.get('geometry'):
|
if not self.cleaned_data.get('geometry'):
|
||||||
raise ValidationError('Missing geometry.')
|
raise ValidationError('Missing geometry.')
|
||||||
|
|
||||||
data = self.cleaned_data['data']
|
if 'data' in self.fields:
|
||||||
if self.cleaned_data['fill_quest']:
|
data = self.cleaned_data['data']
|
||||||
if self.cleaned_data['data'].wifi:
|
if self.cleaned_data['fill_quest']:
|
||||||
raise ValidationError(_('Why is there WiFi scan data if this is a fill quest?'))
|
if self.cleaned_data['data'].wifi:
|
||||||
else:
|
raise ValidationError(_('Why is there WiFi scan data if this is a fill quest?'))
|
||||||
if not self.cleaned_data['data'].wifi:
|
else:
|
||||||
raise ValidationError(_('WiFi scan data is missing.'))
|
if not self.cleaned_data['data'].wifi:
|
||||||
self.cleaned_data['data'].wifi = [[item for item in scan if item.ssid] for scan in data.wifi]
|
raise ValidationError(_('WiFi scan data is missing.'))
|
||||||
|
self.cleaned_data['data'].wifi = [[item for item in scan if item.ssid] for scan in data.wifi]
|
||||||
|
|
||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue