Commit 01477e83 authored by fred's avatar fred

use listadmin to do the mailman plumbing

parent 72ffb1d9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import hashlib import hashlib
import random import random
import urllib import subprocess
from django.db import models from django.db import models
...@@ -39,14 +39,8 @@ class Subscriber(models.Model) : ...@@ -39,14 +39,8 @@ class Subscriber(models.Model) :
self.save() self.save()
def subscribe_in_mailman(self): def subscribe_in_mailman(self):
params = urllib.urlencode( t = subprocess.call(['listadmin', '--add-member', self.email, settings.NEWSLETTER_NAME])
{'email' : self.email, 'fullname' : '', if t != 0:
'pw' : self.password, 'pw-conf' : self.password, return
'digest' : '0'}) self.registered = True
response = urllib.urlopen(settings.NEWSLETTER_SUBSCRIBE_URL, params) self.save()
response.read()
response.close()
# TODO: error handling
# TODO: connecting to the moderation URL to validate
#self.registered = True
#self.save()
Markdown is supported
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