Only require a user to be subcsribed on hidden archives
authorMagnus Hagander <magnus@hagander.net>
Tue, 18 Jun 2019 16:08:20 +0000 (18:08 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 18 Jun 2019 16:08:20 +0000 (18:08 +0200)
For hidden archives, it makes sense to require a subscription in order
to be allowed to log in. But for public archives, any user should be
able to log in to request a re-send of a message.

django/archives/settings.py

index 5761344c8adba127edb02f223a703b2120f19c44..2bb5fa98248f88664de07a5affb81b27a9d8814e 100644 (file)
@@ -155,5 +155,6 @@ if ALLOW_RESEND or not PUBLIC_ARCHIVES:
         'django.contrib.sessions',
     ] + INSTALLED_APPS
 
-    from archives.util import validate_new_user
-    PGAUTH_CREATEUSER_CALLBACK = validate_new_user
+    if not PUBLIC_ARCHIVES:
+        from archives.util import validate_new_user
+        PGAUTH_CREATEUSER_CALLBACK = validate_new_user