diff --git a/src/pretix/base/views/tasks.py b/src/pretix/base/views/tasks.py index 89c12819f6..6302b33740 100644 --- a/src/pretix/base/views/tasks.py +++ b/src/pretix/base/views/tasks.py @@ -28,7 +28,7 @@ from celery import states from celery.result import AsyncResult from django.conf import settings from django.contrib import messages -from django.core.exceptions import ValidationError +from django.core.exceptions import PermissionDenied, ValidationError from django.http import HttpResponse, JsonResponse, QueryDict from django.shortcuts import redirect, render from django.test import RequestFactory @@ -149,6 +149,8 @@ class AsyncMixin: return redirect(self.get_success_url(value)) def error(self, exception): + if isinstance(exception, PermissionDenied): + raise exception messages.error(self.request, self.get_error_message(exception)) if "ajax" in self.request.POST or "ajax" in self.request.GET: return JsonResponse({ @@ -337,8 +339,8 @@ class AsyncPostView(AsyncMixin, View): depend on the request object unless specifically supported by this class. File upload is currently also not supported. """ - known_errortypes = ['ValidationError'] - expected_exceptions = (ValidationError,) + known_errortypes = ['ValidationError', 'PermissionDenied'] + expected_exceptions = (ValidationError, PermissionDenied) task_base = ProfiledEventTask def async_set_progress(self, percentage): diff --git a/src/pretix/control/templates/pretixcontrol/checkin/index.html b/src/pretix/control/templates/pretixcontrol/checkin/index.html index 63d6ef332d..2fc3c1fb7c 100644 --- a/src/pretix/control/templates/pretixcontrol/checkin/index.html +++ b/src/pretix/control/templates/pretixcontrol/checkin/index.html @@ -82,8 +82,10 @@ - + {% if "can_change_orders" in request.eventpermset or "can_checkin_orders" in request.eventpermset %} + + {% endif %} {% trans "Order code" %} @@ -125,7 +127,7 @@ {% for e in entries %} - {% if "can_change_orders" in request.eventpermset %} + {% if "can_change_orders" in request.eventpermset or "can_checkin_orders" in request.eventpermset %} {% endif %} @@ -198,7 +200,7 @@ - {% if "can_change_orders" in request.eventpermset %} + {% if "can_change_orders" in request.eventpermset or "can_checkin_orders" in request.eventpermset %} + {% endif %} + {% if "can_change_orders" in request.eventpermset %}