From 3a58f869bb8282e85a89bb269d6f3d4d1ad9ee7a Mon Sep 17 00:00:00 2001 From: Topvennie Date: Tue, 14 May 2024 10:59:16 +0200 Subject: [PATCH] fix: docker image owner --- backend/api/serializers/docker_serializer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/api/serializers/docker_serializer.py b/backend/api/serializers/docker_serializer.py index eb009eb3..ee7b2c1f 100644 --- a/backend/api/serializers/docker_serializer.py +++ b/backend/api/serializers/docker_serializer.py @@ -13,7 +13,8 @@ class Meta: def validate(self, attrs): data = super().validate(attrs=attrs) - data["owner"] = self.context["request"].user + if not self.partial: + data["owner"] = self.context["request"].user if "public" in data and data["public"] and not data["owner"].is_staff: raise ValidationError(_("docker.errors.custom"))