From f257dca9d70e2db41c4d77df03e0160b864ecdd7 Mon Sep 17 00:00:00 2001 From: Matti Lamppu Date: Thu, 12 Sep 2024 11:03:45 +0300 Subject: [PATCH] Fix reservation user not being saved by mistake --- api/graphql/types/reservation/serializers/create_serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/graphql/types/reservation/serializers/create_serializers.py b/api/graphql/types/reservation/serializers/create_serializers.py index 4b1b0bb0d..5e5bfd414 100644 --- a/api/graphql/types/reservation/serializers/create_serializers.py +++ b/api/graphql/types/reservation/serializers/create_serializers.py @@ -165,7 +165,7 @@ def validate(self, data: dict[str, Any], prefill_from_profile: bool = True) -> d data["buffer_time_before"], data["buffer_time_after"] = self._calculate_buffers(begin, end, reservation_units) request_user: AnyUser = self.context["request"].user - data["user"] = request_user if request_user.is_anonymous else None + data["user"] = None if request_user.is_anonymous else request_user data["reservee_used_ad_login"] = ( False if request_user.is_anonymous else getattr(request_user.id_token, "is_ad_login", False) )