Don't require antispam auth on private archives
authorMagnus Hagander <magnus@hagander.net>
Wed, 20 Jun 2018 08:43:44 +0000 (10:43 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 20 Jun 2018 08:46:03 +0000 (10:46 +0200)
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

index fc09b65e92b6273d0cc3b3da4b05e0fe706e67cd..0e3a47d62a1413e07606b3b4257b4a6f3eb3b6fd 100644 (file)
@@ -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: