diff --git a/src/pretix/control/views/user.py b/src/pretix/control/views/user.py index 913c965e8c..b2d6f74ee3 100644 --- a/src/pretix/control/views/user.py +++ b/src/pretix/control/views/user.py @@ -22,6 +22,7 @@ from django.views import View from django.views.generic import FormView, ListView, TemplateView, UpdateView from django_otp.plugins.otp_static.models import StaticDevice from django_otp.plugins.otp_totp.models import TOTPDevice +from django_scopes import scopes_disabled from pretix.base.auth import get_auth_backends from pretix.base.forms.auth import ReauthForm @@ -578,6 +579,10 @@ class User2FARegenerateEmergencyView(RecentAuthenticationRequiredMixin, Template class UserNotificationsDisableView(TemplateView): template_name = 'pretixcontrol/user/notifications_disable.html' + @scopes_disabled() + def dispatch(self, request, *args, **kwargs): + return super().dispatch(self, request, *args, **kwargs) + def post(self, request, *args, **kwargs): user = get_object_or_404(User, notifications_token=kwargs.get('token'), pk=kwargs.get('id')) user.notifications_send = False