Devices: Fix crash in form validation

This commit is contained in:
Raphael Michel
2023-06-02 15:52:56 +02:00
parent 35d2a73f75
commit ee9acebe03

View File

@@ -273,7 +273,7 @@ class DeviceForm(forms.ModelForm):
def clean(self): def clean(self):
d = super().clean() d = super().clean()
if not d['all_events'] and not d['limit_events']: if not d['all_events'] and not d.get('limit_events'):
raise ValidationError(_('Your device will not have access to anything, please select some events.')) raise ValidationError(_('Your device will not have access to anything, please select some events.'))
return d return d