diff --git a/aleksis/apps/alsijil/schema/absences.py b/aleksis/apps/alsijil/schema/absences.py index 6bb9b9481a1120efb172578f13d8e03d5b0ad9a0..88ec2ce557783aa9a4a32e6e3351d26b1bed500c 100644 --- a/aleksis/apps/alsijil/schema/absences.py +++ b/aleksis/apps/alsijil/schema/absences.py @@ -67,25 +67,24 @@ class AbsencesBatchCreateMutation(graphene.Mutation): # Create a ParticipationStatus for each documentation for doc in docs: - # TODO: Is ID for enough for person&reason OR should it - # resolve to django object first? + # Set person & absence_reason directly from id ParticipationStatus.objects.create( - person=person, + person_id=person, related_documentation=doc, - absence_reason=reason, + absence_reason_id=reason, ) # If there are still dummy documentations in the future # create a Kolego Absence if future: - # TODO: Should probably lookup person&reason as well # TODO: Are date_start & date_end from CalendarEvent enough # or more needed? + # Set reason & person directly from id Absence.objects.create( date_start=datetime.now().date(), date_end=end, - reason=reason, - person=person, + reason_id=reason, + person_id=person, comment=comment, )