shiftregister/shiftregister/importer/tasks.py

12 lines
263 B
Python

from celery import shared_task
from .importer import import_calendar
from .models import Calendar
@shared_task
def import_shifts():
for calendar in Calendar.objects.all():
calendar.has_errors = not import_calendar(calendar)
calendar.save()