Commit c55da72b authored by fred's avatar fred
Browse files

handle emails already subscribed to mailman

parent 93cbe21d
......@@ -62,8 +62,18 @@ class Subscriber(models.Model):
return self.subscribe_in_mailchimp()
def subscribe_in_mailman(self):
t =['listadmin', '--add-member',, settings.NEWSLETTER_NAME])
if t != 0:
['listadmin', '--add-member',, settings.NEWSLETTER_NAME], check_call=True
except subprocess.CalledProcessError:
# maybe an error because email is already registered?
result =
['listadmin', '-l', 'newsletter-panik'], check=True, capture_output=True, text=True
if in result.stdout.splitlines():
self.is_registered = True
self.is_registered = True
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment