From f094ee66d5b454155d11bead4544d5d1c60012a9 Mon Sep 17 00:00:00 2001
From: nd <git@notandy.de>
Date: Sun, 21 Mar 2021 15:06:39 +0100
Subject: [PATCH] fixup! handle multiple mail addresses and cancle any
 subscription requests for addresses we try to subscribe

---
 .../management/commands/syncldapmemberships.py                  | 2 +-
 setup.py                                                        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/postorius_ldap_membership_management/management/commands/syncldapmemberships.py b/postorius_ldap_membership_management/management/commands/syncldapmemberships.py
index 013f453..e1fa114 100644
--- a/postorius_ldap_membership_management/management/commands/syncldapmemberships.py
+++ b/postorius_ldap_membership_management/management/commands/syncldapmemberships.py
@@ -83,7 +83,7 @@ class Command(BaseCommand):
 							# user might not be subscribed but should be subscribed -> subscribe
 							# we do not test if he is subscibed already because the mailman api is inconsistent and reports wrong state information for this...
 							# instead we always try to subscribe and catch the error if we are subscribed already
-							for address in mm_user.addresses[0]:
+							for address in mm_user.addresses:
 								user_mail = address.email
 								if membership_type == 'member':
 									# discard a subscription request before trying to subscribe else it will fail
diff --git a/setup.py b/setup.py
index 2fac7ae..bc3dd97 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 
 setup(name='postorius_ldap_membership_management',
-	version='1.1',
+	version='1.2',
 	description='Sync subscriptions from ldap',
 	url='https://git.cccv.de:infra/uffd/postorius-ldap-membership-management',
 	author='Andreas Valder',
-- 
GitLab