Commit 01477e83 authored by fred's avatar fred

use listadmin to do the mailman plumbing

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