From 94e8c6295303f2ad60e05f92fc1187338b681264 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 13 Mar 2025 18:52:47 +0800 Subject: [PATCH] fix: Allow empty files in FileSerializer --- apps/ops/serializers/job.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ops/serializers/job.py b/apps/ops/serializers/job.py index 15a13efa5..0864b62d9 100644 --- a/apps/ops/serializers/job.py +++ b/apps/ops/serializers/job.py @@ -8,8 +8,8 @@ from common.serializers import WritableNestedModelSerializer from common.serializers.fields import ReadableHiddenField, ObjectRelatedField from ops.mixin import PeriodTaskSerializerMixin from ops.models import Job, JobExecution -from orgs.mixins.serializers import BulkOrgResourceModelSerializer from ops.serializers import JobVariableSerializer +from orgs.mixins.serializers import BulkOrgResourceModelSerializer class JobSerializer(BulkOrgResourceModelSerializer, PeriodTaskSerializerMixin, WritableNestedModelSerializer): @@ -73,7 +73,7 @@ class JobSerializer(BulkOrgResourceModelSerializer, PeriodTaskSerializerMixin, W class FileSerializer(serializers.Serializer): - files = serializers.FileField(allow_empty_file=False, max_length=128) + files = serializers.FileField(allow_empty_file=True, max_length=128) class Meta: ref_name = "JobFileSerializer"