management command to set active campaigns to UNSUCCESSFUL, trigger amazon notice
parent
e928a2dfa1
commit
3d7cd7fdae
|
@ -0,0 +1,18 @@
|
|||
"""
|
||||
print user emails
|
||||
"""
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
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
|
Loading…
Reference in New Issue