Skip to content
Snippets Groups Projects
Commit f1072ee6 authored by Valentin Groues's avatar Valentin Groues :eyes:
Browse files

don't import public holidays for flying team

parent 3562104a
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -2,7 +2,7 @@ import datetime
from django.core.management.base import BaseCommand
from ...models import Appointment, Location, AppointmentType
from ...models import Appointment, Location, AppointmentType, AppointmentTypeLink
appointment_type_other = AppointmentType.objects.filter(code='OTHER').first()
......@@ -22,7 +22,7 @@ class Command(BaseCommand):
parser.add_argument('year', nargs='+', type=int)
def handle(self, *args, **options):
for location in Location.objects.all():
for location in Location.objects.exclude(name="Flying Team").all():
for year in options['year']:
self.stdout.write("importing holidays for year {} and location {}".format(year, location))
# new years day
......@@ -64,7 +64,8 @@ class Command(BaseCommand):
holiday.comment = comment
holiday.visit_id = None
holiday.save()
holiday.appointment_types = [appointment_type_other]
link = AppointmentTypeLink(appointment=holiday, appointment_type=appointment_type_other)
link.save()
def get_easter_sunday_date(year):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment