From 5b9b23da5c73b6f7ecf9279a8e34607126c1e3e5 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 20 Jun 2018 10:43:44 +0200 Subject: [PATCH] Don't require antispam auth on private archives Private archives already requires the user to log in with a community account, so there is no point in *also* requiring the archives/antispam authentication step. --- django/archives/mailarchives/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/django/archives/mailarchives/views.py b/django/archives/mailarchives/views.py index fc09b65..0e3a47d 100644 --- a/django/archives/mailarchives/views.py +++ b/django/archives/mailarchives/views.py @@ -109,6 +109,9 @@ def nocache(fn): # Decorator to require http auth def antispam_auth(fn): def _antispam_auth(request, *_args, **_kwargs): + if not settings.PUBLIC_ARCHIVES: + return fn(request, *_args, **_kwargs) + if 'HTTP_AUTHORIZATION' in request.META: auth = request.META['HTTP_AUTHORIZATION'].split() if len(auth) != 2: -- 2.39.5