Skip to content
Snippets Groups Projects
Commit 3806c55a authored by Carlos Vega's avatar Carlos Vega
Browse files

manual cherry pick of the fix for the appointmentType 'other' issue

parent bbea6d17
No related branches found
No related tags found
3 merge requests!208Update/merge 12 into 13,!207Merge Devel 0.12.x into Master (0.13.x),!202Bug/fix requirements and code for tests to pass
Pipeline #7807 passed
......@@ -4,9 +4,6 @@ from django.core.management.base import BaseCommand
from ...models import Appointment, Location, AppointmentType, AppointmentTypeLink
appointment_type_other = AppointmentType.objects.filter(code='OTHER').first()
def get_easter_monday(easter_sunday):
return next_weekday(easter_sunday, 0)
......@@ -64,6 +61,7 @@ class Command(BaseCommand):
holiday.comment = comment
holiday.visit_id = None
holiday.save()
appointment_type_other = AppointmentType.objects.get_or_create(code='OTHER', defaults={default_duration: 60})
link = AppointmentTypeLink(appointment=holiday, appointment_type=appointment_type_other)
link.save()
......@@ -92,4 +90,4 @@ def next_weekday(day_datetime, week_day):
days_ahead = week_day - day_datetime.weekday()
if days_ahead <= 0:
days_ahead += 7
return day_datetime + datetime.timedelta(days_ahead)
return day_datetime + datetime.timedelta(days_ahead)
\ No newline at end of file
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