From cac233ac1f211555ef6155f3b2e00a398a1702a4 Mon Sep 17 00:00:00 2001 From: Topvennie Date: Wed, 15 May 2024 18:35:52 +0200 Subject: [PATCH] chore: cleanup my booboo --- backend/api/serializers/docker_serializer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/api/serializers/docker_serializer.py b/backend/api/serializers/docker_serializer.py index 3dfdce99..dc1f2a66 100644 --- a/backend/api/serializers/docker_serializer.py +++ b/backend/api/serializers/docker_serializer.py @@ -15,8 +15,8 @@ def validate(self, attrs): if not self.partial: data["owner"] = self.context["request"].user - else: - data["owner"] = data["owner"] if "owner" in data else self.instance.owner + elif "owner" not in data: + data["owner"] = self.instance.owner if "public" in data and data["public"] and not data["owner"].is_staff: raise ValidationError(_("docker.errors.custom"))