summaryrefslogtreecommitdiff
path: root/src/mailman/model/user.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/model/user.py')
-rw-r--r--src/mailman/model/user.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mailman/model/user.py b/src/mailman/model/user.py
index 3d02b2777..783d7f7b7 100644
--- a/src/mailman/model/user.py
+++ b/src/mailman/model/user.py
@@ -189,13 +189,14 @@ class User(Model):
# Merge memberships.
other_members = store.query(Member).filter(
Member.user_id == user.id)
- # (only import memberships of lists I'm not subscribed to yet)
subscribed_lists = [ m.list_id for m in self.memberships.members ]
- if subscribed_lists:
- other_members = other_members.filter(
- not_(Member.list_id.in_(subscribed_lists)))
for member in other_members:
- member.user_id = self.id
+ # Only import memberships of lists I'm not subscribed to yet,
+ # delete the rest.
+ if member.list_id not in subscribed_lists:
+ member.user_id = self.id
+ else:
+ store.delete(member)
# Merge the user preferences
self.preferences.absorb(user.preferences)
# Merge display_name, password and is_server_owner attributes.