Skip to content
Snippets Groups Projects
Commit 45a76ff1 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Fix scheduling for AKs that don't have a room yet

parent f133e2b8
Branches
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ class EventSerializer(serializers.ModelSerializer):
# Updated room if needed (pk changed -- otherwise, no need for an additional database lookup)
new_room_id = validated_data.get('room')["pk"]
if instance.room.pk != new_room_id:
if instance.room is None or instance.room.pk != new_room_id:
instance.room = get_object_or_404(Room, pk=new_room_id)
instance.save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment