From f50548cd02379b138261da24c0891c0d63756491 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 10 Apr 2026 09:45:47 +0200 Subject: [PATCH] Fix crash on build --- src/pretix/helpers/monkeypatching.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/helpers/monkeypatching.py b/src/pretix/helpers/monkeypatching.py index 59f25bf7c..6b3509f64 100644 --- a/src/pretix/helpers/monkeypatching.py +++ b/src/pretix/helpers/monkeypatching.py @@ -114,7 +114,7 @@ def monkeypatch_urllib3_ssrf_protection(): This does not work when a global http(s) proxy is used, but in that scenario the proxy can perform the validation. """ - if settings.ALLOW_HTTP_TO_PRIVATE_NETWORKS: + if getattr(settings, "ALLOW_HTTP_TO_PRIVATE_NETWORKS", False): # Settings are not supposed to change during runtime, so we can optimize performance and complexity by skipping # this if not needed. return @@ -144,7 +144,7 @@ def monkeypatch_urllib3_ssrf_protection(): for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res - if not settings.ALLOW_HTTP_TO_PRIVATE_NETWORKS: + if not getattr(settings, "ALLOW_HTTP_TO_PRIVATE_NETWORKS", False): ip_addr = ipaddress.ip_address(sa[0]) if ip_addr.is_multicast: raise HTTPError(f"Request to multicast address {sa[0]} blocked")