diff --git a/backend/api/serializers/docker_serializer.py b/backend/api/serializers/docker_serializer.py index 115da192..3dfdce99 100644 --- a/backend/api/serializers/docker_serializer.py +++ b/backend/api/serializers/docker_serializer.py @@ -16,7 +16,7 @@ def validate(self, attrs): if not self.partial: data["owner"] = self.context["request"].user else: - data["owner"] = self.instance.owner + data["owner"] = data["owner"] if "owner" in data else self.instance.owner if "public" in data and data["public"] and not data["owner"].is_staff: raise ValidationError(_("docker.errors.custom"))