diff --git a/src/pretix/control/forms/organizer.py b/src/pretix/control/forms/organizer.py index 118af4eefb..a427c6f7de 100644 --- a/src/pretix/control/forms/organizer.py +++ b/src/pretix/control/forms/organizer.py @@ -173,6 +173,13 @@ class DeviceForm(forms.ModelForm): super().__init__(*args, **kwargs) self.fields['limit_events'].queryset = organizer.events.all() + def clean(self): + d = super().clean() + if not d['all_events'] and not d['limit_events']: + raise ValidationError(_('Your device will not have access to anything, please select some events.')) + + return d + class Meta: model = Device fields = ['name', 'all_events', 'limit_events']