From 7d53150779055f5b999b3e4fbe5a6fc93ece7170 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sun, 19 Feb 2023 15:45:20 +0100 Subject: [PATCH] Fix crash on invalid download URL --- src/pretix/base/views/cachedfiles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/views/cachedfiles.py b/src/pretix/base/views/cachedfiles.py index c0690a475..e425e4805 100644 --- a/src/pretix/base/views/cachedfiles.py +++ b/src/pretix/base/views/cachedfiles.py @@ -19,6 +19,7 @@ # You should have received a copy of the GNU Affero General Public License along with this program. If not, see # . # +from django.core.exceptions import ValidationError from django.http import Http404, HttpRequest, HttpResponse from django.shortcuts import get_object_or_404 from django.utils.functional import cached_property @@ -39,7 +40,7 @@ class DownloadView(TemplateView): if o.session_key != self.request.session.session_key: raise Http404() return o - except ValueError: # Invalid URLs + except (ValueError, ValidationError): # Invalid URLs raise Http404() def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: