17 Mar
2022
17 Mar
'22
6:06 p.m.
On 3/17/22 10:19, Quanah Gibson-Mount wrote:
So then I ran your code to confirm it, and it blows up with an error:
>>>> for token, data in pendings.find(pend_type='subscription'):
> ... if data['token_owner'] != 'subscriber':
> ... continue
> ... if data['email'] != 'xxxxxxxx@xxxxx.org':
> ... continue
> ... sub_mgr.confirm(token)
> ...
> Traceback (most recent call last):
> File "<console>", line 6, in <module>
> File "/usr/lib/python3/dist-packages/mailman/app/subscriptions.py",
> line 545, in confirm
> workflow.restore()
> File "/usr/lib/python3/dist-packages/mailman/app/workflow.py", line
> 149, in restore
> setattr(self, attr, data[attr])
> File "/usr/lib/python3/dist-packages/mailman/app/subscriptions.py",
> line 119, in address_key
> assert self.address is not None
> AssertionError
This says that there is no Address object with the email xxxxxxxx@xxxxx.org
What do you get in mailman shell
for
>>> um = getUtility(IUserManager)
>>> um.get_address('xxxxxxxx@xxxxx.org')
>>> um.get_user('xxxxxxxx@xxxxx.org')
These should return an Address and a User respectively. If they don't, did you perhaps run some process to delete the user?
If the user is gone, you should be able to replace
... sub_mgr.confirm(token)
in the above with
... wfm = getUtility(IWorkflowStateManager)
... pendings.confirm(token, expunge=True)
... wfm.discard(token)
to clear the pending subscription and workflow and then be able to mass subscribe the user.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan