Skip to content
Snippets Groups Projects
Verified Commit c17a49b0 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix get_or_crate in Documentation.create_from_lesson_event

parent a1aedec2
No related branches found
No related tags found
1 merge request!442Resolve "Handle UniqueConstraint errors while saving coursebook"
Pipeline #194010 failed
......@@ -302,14 +302,13 @@ class Documentation(CalendarEvent):
lesson_event.teachers,
)
obj, __ = cls.objects.get_or_create(
obj, __ = cls.objects.update_or_create(
datetime_start=datetime_start,
datetime_end=datetime_end,
course=course,
defaults=dict(subject=subject, amends=lesson_event),
amends=lesson_event,
defaults=dict(subject=subject, course=course),
)
obj.teachers.set(teachers.all())
obj.save()
# Create Participation Statuses
obj.touch()
......
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