Skip to content
Snippets Groups Projects
Commit 72dc2ff3 authored by permcu's avatar permcu Committed by Julian
Browse files

Properly set person & reason by id

parent c2869295
No related branches found
No related tags found
1 merge request!360Resolve "Add absence management to course book student dialog"
......@@ -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,
)
......
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