Mark Sapiro wrote:
On 7/28/20 5:40 AM, Brian Carpenter wrote:
This is the client that I asking about in my post. She said what I did, did not work. This is what I did:
Get into a venv as user mailman
#mailman shell from mailman.model.mailinglist import MailingList mlist = MailingList('listname@listdomain.org') mlist.emergency = False commit() ctrl-d (just to be on the safe side)
I half understand why this didn't work. Instantiating the list via
from mailman.model.mailinglist import MailingList
mlist = MailingList('listname@listdomain.org')
for some reason (that's the half I don't understand) does not get the actual list object so changes you make to it don't affect the actual list. In mailman shell
you need to do
mlist = getUtility(IListManager).get('listname@listdomain.org')
getUtility
and IListManager
are in the namespace in mailman shell
, but outside of that, e.g. just in python
in your virtualenv, you also need
from mailman.interfaces.listmanager import IListManager
from zope.component import getUtility
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan