Update schedule module

This commit is contained in:
2020-05-14 15:20:19 +02:00
parent 5be8fa9c6d
commit d9899f2d56
17 changed files with 871 additions and 701 deletions

View File

@ -0,0 +1,24 @@
from django.core.management.base import BaseCommand, CommandError
from apps.schedule.models import Schedule
#from polls.models import Question as Poll
class Command(BaseCommand):
help = 'Send out all the new reports'
# def add_arguments(self, parser):
# parser.add_argument('poll_ids', nargs='+', type=int)
def handle(self, *args, **options):
Schedule.objects.filter(peregrine_result__isnull=False).filter(report_sent__isnull=True)
# for poll_id in options['poll_ids']:
# try:
# poll = Poll.objects.get(pk=poll_id)
# except Poll.DoesNotExist:
# raise CommandError('Poll "%s" does not exist' % poll_id)
# poll.opened = False
# poll.save()
# self.stdout.write(self.style.SUCCESS('Successfully closed poll "%s"' % poll_id))