Skip to content
Snippets Groups Projects
Commit 54f6c46e authored by Julian's avatar Julian
Browse files

Create participations when creating documentations

parent a6a5c257
No related branches found
No related tags found
1 merge request!362Resolve "Add personal note management dialog in course book"
Pipeline #185058 failed
......@@ -678,6 +678,24 @@ class Documentation(CalendarEvent):
)
obj.teachers.set(teachers.all())
obj.save()
# Create Participation Statuses
# Cannot use djangos bulk_create method, as then the save method of the
# superclass wouldn't be called
for member in lesson_event.all_members:
# TODO: Check for preexisting absences in kolego
# TODO: maybe only create if the lesson start is in the past
status = ParticipationStatus.objects.create(
person=member,
related_documentation=obj,
datetime_start=datetime_start,
datetime_end=datetime_end,
timezone=lesson_event.timezone,
)
status.groups_of_person.set(member.member_of.all())
status.save()
return obj
@classmethod
......
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