Commit 47b0b820 authored by Baptiste Jonglez's avatar Baptiste Jonglez Committed by jocelyn

Add a Django command for dumping the email address of all subscribers

parent 40458e8a
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from import BaseCommand, CommandError
from django.db.models import Q
from coin.offers.models import OfferSubscription
class Command(BaseCommand):
help = 'Returns the email addresses of all subscribers, in a format suitable for bulk importing in Sympa'
def handle(self, *args, **options):
emails = [ for s in OfferSubscription.objects.filter(Q( | Q(resign_date__isnull=True))]
# Use a set to ensure uniqueness
for email in set(emails):
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