From 46b3e3c7394b933d383ecde5ae9c0ec30362c2d2 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 21 Feb 2022 16:59:51 +0100 Subject: [PATCH] AsyncFormView: Allow to declare celery exception classes --- src/pretix/base/views/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/views/tasks.py b/src/pretix/base/views/tasks.py index 1eeb8515eb..a757fbd7da 100644 --- a/src/pretix/base/views/tasks.py +++ b/src/pretix/base/views/tasks.py @@ -205,6 +205,7 @@ class AsyncFormView(AsyncMixin, FormView): Also, all form keyword arguments except ``instance`` need to be serializable. """ known_errortypes = ['ValidationError'] + expected_exceptions = [ValidationError] task_base = ProfiledEventTask def __init_subclass__(cls): @@ -243,7 +244,7 @@ class AsyncFormView(AsyncMixin, FormView): base=cls.task_base, bind=True, name=cls.__module__ + '.' + cls.__name__ + '.async_execute', - throws=(ValidationError,) + throws=cls.expected_exceptions )(async_execute) def async_form_valid(self, task, form):