22 Apr
2022
22 Apr
'22
4:16 p.m.
On 4/22/22 02:11, Chris via Mailman-users wrote:
Mark Sapiro wrote:
I suggest the following in mailman shell
>> $ bin/mailman shell -l list.example.com
>> Welcome to the GNU Mailman shell
>> Use commit() to commit changes.
>> Use abort() to discard changes since the last commit.
>> Exit with ctrl+D does an implicit commit() but exit() does not.
>> The variable 'm' is the list.example.com mailing list
>> >>> from mailman.app.moderator import handle_message
>> >>> requestdb = IListRequests(m)
>> >>> for id, type in requestdb.held_requests:
>> ... if type == RequestType.held_message:
>> ... handle_message(m, id, Action.discard)
>> ...
>> >>> commit()
Thanks for the reply, unfortunately that gives an error: Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: cannot unpack non-iterable _Request object
Sorry, my mistake.
Try this:
$ bin/mailman shell -l list.example.com
Welcome to the GNU Mailman shell
Use commit() to commit changes.
Use abort() to discard changes since the last commit.
Exit with ctrl+D does an implicit commit() but exit() does not.
The variable 'm' is the list.example.com mailing list
>>> from mailman.app.moderator import handle_message
>>> requestdb = IListRequests(m)
>>> for req in requestdb.held_requests:
... if req.request_type == RequestType.held_message:
... handle_message(m, req.id, Action.discard)
...
>>> commit()
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan