From 87eabaf33d18423dcb73c8700896724d4febe9b9 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 8 Jun 2026 14:41:13 +0200 Subject: [PATCH] Waiting list: Redirect back after voucher edit (Z#23230178) --- .../control/templates/pretixcontrol/waitinglist/index.html | 2 +- src/pretix/control/views/vouchers.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretix/control/templates/pretixcontrol/waitinglist/index.html b/src/pretix/control/templates/pretixcontrol/waitinglist/index.html index 04d8c940c..e1521048a 100644 --- a/src/pretix/control/templates/pretixcontrol/waitinglist/index.html +++ b/src/pretix/control/templates/pretixcontrol/waitinglist/index.html @@ -251,7 +251,7 @@ {% if e.voucher %} - + {{ e.voucher }} {% elif not e.voucher and e.availability.0 == 100 and e.availability.1|default_if_none:"none" != "none" %} diff --git a/src/pretix/control/views/vouchers.py b/src/pretix/control/views/vouchers.py index 4745f887c..afda65a20 100644 --- a/src/pretix/control/views/vouchers.py +++ b/src/pretix/control/views/vouchers.py @@ -51,6 +51,7 @@ from django.shortcuts import redirect, render from django.urls import resolve, reverse from django.utils.functional import cached_property from django.utils.html import format_html +from django.utils.http import url_has_allowed_host_and_scheme from django.utils.safestring import mark_safe from django.utils.timezone import now from django.utils.translation import gettext_lazy as _ @@ -320,6 +321,8 @@ class VoucherUpdate(EventPermissionRequiredMixin, UpdateView): return super().post(request, *args, **kwargs) def get_success_url(self) -> str: + if "next" in self.request.GET and url_has_allowed_host_and_scheme(self.request.GET.get("next"), allowed_hosts=None): + return self.request.GET.get("next") return reverse('control:event.vouchers', kwargs={ 'organizer': self.request.event.organizer.slug, 'event': self.request.event.slug,