Commit 44e717f3 authored by fred's avatar fred

move the registration to mailman in a management command

parent 8318db23
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from ...models import Subscriber
class Command(BaseCommand):
def handle(self, verbosity, **kwargs):
self.verbose = (verbosity > 1)
for subscriber in Subscriber.objects.filter(is_validated=True).exclude(is_registered=True):
if self.verbose:
print 'subscribing', subscriber.email
subscriber.subscribe_in_mailman()
......@@ -47,7 +47,6 @@ class ConfirmationView(TemplateView):
subscriber = get_object_or_404(Subscriber, password=token, is_validated=False)
subscriber.is_validated = True
subscriber.save()
subscriber.subscribe_in_mailman()
return context
confirmation = ConfirmationView.as_view()
......
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