2012-08-09 13:47:10 +00:00
|
|
|
"""
|
|
|
|
print user emails
|
|
|
|
"""
|
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
2013-06-03 16:31:39 +00:00
|
|
|
|
2012-08-09 13:47:10 +00:00
|
|
|
from regluit.core import models, signals
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "set active campaigns to unsuccessful"
|
|
|
|
|
|
|
|
def handle(self, **options):
|
|
|
|
for campaign in models.Campaign.objects.filter(status='ACTIVE'):
|
|
|
|
campaign.status = 'UNSUCCESSFUL'
|
|
|
|
campaign.save()
|
|
|
|
action = models.CampaignAction(campaign=campaign, type='failed', comment = 'amazon suspension')
|
|
|
|
action.save()
|
|
|
|
signals.amazon_suspension.send(sender=None,campaign=campaign)
|
|
|
|
print 'campaign %s set to UNSUCCESSFUL' % campaign.id
|