On 11/5/24 11:09, Jose Bernal via Mailman-users wrote:
I've got a list member showing up twice in a list (same email address). Can't use the GUI to remove the member from this list (get a 503 error) Screenshots attached, underlying database query reveals no duplicates. Wondering how this is possible or where else I should be looking to resolve this duplicate before I simply remove their entry from the members table altogether.
I'm not sure how this could have happened, I need more info for that,
but to deal with this use mailman shell
as in
$ 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
>>> x = m.memberships('user@example.com')
This should set x to a list of that users memberships You can then
examine x[0] and x[1] to determine which to delete. e.g.
>>> dir(x[0])
['__abstract__', '__class__', '__delattr__', '__dict__', '__dir__',
'__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
'__getstate__', '__gt__', '__hash__', '__implemented__', '__init__',
'__init_subclass__', '__le__', '__lt__', '__mapper__', '__module__',
'__ne__', '__new__', '__providedBy__', '__provides__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', '__table__', '__tablename__', '__weakref__',
'_address', '_lookup', '_mailing_list', '_member_id', '_reset',
'_sa_class_manager', '_sa_instance_state', '_sa_registry', '_user',
'acknowledge_posts', 'address', 'address_id', 'bounce_score',
'delivery_mode', 'delivery_status', 'display_name', 'id',
'last_bounce_received', 'last_warning_sent', 'list_id', 'mailing_list',
'member_id', 'metadata', 'moderation_action', 'preferences',
'preferences_id', 'preferred_language', 'receive_list_copy',
'receive_own_postings', 'registry', 'role', 'subscriber',
'subscription_mode', 'total_warnings_sent', 'unsubscribe', 'user',
'user_id']
This gives the list of attributes which can be examined with, e.g.
>>> x[0].delivery_mode
<DeliveryMode.regular: 1>
You can then remove the one you don't want, e.g.
>>> x[0].unsubscribe()
>>> commit()
Just to be sure, you should ensure that x[0].member_id and x[1].member_id are different. These are the _member_id column in the member table in the database.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan