Skip to content
Snippets Groups Projects
Verified Commit d14190e9 authored by nd's avatar nd
Browse files

handle multiple mail addresses and cancle any subscription requests for...

handle multiple mail addresses and cancle any subscription requests for addresses we try to subscribe
parent 1fef9503
No related branches found
No related tags found
No related merge requests found
...@@ -83,8 +83,13 @@ class Command(BaseCommand): ...@@ -83,8 +83,13 @@ class Command(BaseCommand):
# user might not be subscribed but should be subscribed -> subscribe # 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... # 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 # instead we always try to subscribe and catch the error if we are subscribed already
user_mail = mm_user.addresses[0].email for address in mm_user.addresses[0]:
user_mail = address.email
if membership_type == 'member': if membership_type == 'member':
# discard a subscription request before trying to subscribe else it will fail
for request in mm_list.requests:
if request['email'] == user_mail:
mm_list.discard_request(request['token'])
mm_list.subscribe(user_mail, mm_list.subscribe(user_mail,
display_name=displayname, display_name=displayname,
pre_verified=True, pre_verified=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment