From: Magnus Hagander Date: Wed, 20 Jun 2018 08:43:44 +0000 (+0200) Subject: Don't require antispam auth on private archives X-Git-Url: http://git.postgresql.org/gitweb/static/session/%7B%7Bsession.id%7D%7D-%7B%7Bsession.title%7Cslugify%7D%7D?a=commitdiff_plain;h=5b9b23da5c73b6f7ecf9279a8e34607126c1e3e5;p=pgarchives.git 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. --- 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: