Only show lists that allow subscriber access
authorMagnus Hagander <magnus@hagander.net>
Mon, 15 Jan 2018 18:43:55 +0000 (20:43 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 15 Jan 2018 18:43:55 +0000 (20:43 +0200)
No point in listing superuser-only lists, since they can't be accessed
without, well, superuser, anyway.

django/archives/mailarchives/views.py

index da00d7bf880ca8a8787a8c59dcb194aeeeda267b..1da3c812c55a875e27ae65bd7b1f08f10fc10988 100644 (file)
@@ -134,7 +134,7 @@ def get_all_groups_and_lists(request, listid=None):
        if settings.PUBLIC_ARCHIVES or request.user.is_superuser:
                lists = List.objects.select_related('group').all().order_by('listname')
        else:
-               lists = List.objects.select_related('group').filter(listsubscriber__username=request.user.username).order_by('listname')
+               lists = List.objects.select_related('group').filter(subscriber_access=True, listsubscriber__username=request.user.username).order_by('listname')
        listgroupid = None
        groups = {}
        for l in lists: