Do not display any lists on index the page (/postorius/lists/) by default (when you create the list it defaults to Hide) - Debian package install
Hi all,
I am currently in the process of moving from mailman 2.1 to mailman 3, the basic functions are completed (mailing list and archiving). On our current mailman 2.1 install it advises there are no publicly advertised lists, when I visit mailman3-list.domain/postorius/lists/ I see all the lists that have been created, I require them not to be displayed. I know when you create a list you can on the 'Advertise this list' line select 'Hide this list in list index', but I would like it to default to this in case somebody forgets to select it.
I am not a Python expert, though from the description at the top of the below file and the contents further down it looks like you are defining in base.py and then in default.py you are using what was defined, a class of 'Private' which should cause the lists not to be advertised, but they are?
File: /usr/ib/python3/dist-packages/mailman/styles/base.py
class Private: """Settings for private mailing lists."""
def apply(self, mailing_list):
mlist = mailing_list
mlist.advertised = False <--------------
mlist.archive_policy = ArchivePolicy.private
mlist.subscription_policy = SubscriptionPolicy.confirm_then_moderate
File: /usr/lib/python3/dist-packages/mailman/styles/default.py
class PrivateDefaultStyle( Identity, BasicOperation, Bounces, Private, Discussion, Moderation):
"""Style for mailing-lists with private archives."""
name = 'private-default'
description = _('Discussion mailing list style with private archives.')
def apply(self, mailing_list):
"""See `IStyle`."""
Identity.apply(self, mailing_list)
BasicOperation.apply(self, mailing_list)
Bounces.apply(self, mailing_list)
Private.apply(self, mailing_list)
Discussion.apply(self, mailing_list)
Moderation.apply(self, mailing_list)
I added the below to /etc/mailman3/mailman.cfg:
[styles] # The default style to apply if nothing else was requested. The value is the # name of an existing style. If no such style exists, no style will be # applied. default: private-default
I took 'private-default' from /usr/lib/python3/dist-packages/mailman/styles/default.py, this means now when a new list is created the List style is 'Discussion mail list style with private archives so it is not displayed when you are logged out at /hyperkitty.
Many thanks
Daniel
participants (1)
-
daniel.bottingļ¼ codethink.co.uk