From 173d9f8987535bb859ea1bec20318f30da0d1b93 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 10 Feb 2022 13:58:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E5=A1=AB=E5=86=99=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=9B=B4=E5=87=86=E7=A1=AE=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/qm/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hb_server/apps/qm/views.py b/hb_server/apps/qm/views.py index 4c653a1..245f0cb 100644 --- a/hb_server/apps/qm/views.py +++ b/hb_server/apps/qm/views.py @@ -87,8 +87,9 @@ class TestRecordViewSet(ListModelMixin, UpdateModelMixin, RetrieveModelMixin, De raise exceptions.APIException('该记录已提交') # 校验是否有未填项目 if obj.type != TestRecord.TEST_PROCESS_RE and obj.is_midtesting is False: - if TestRecordItem.objects.filter(field_value__isnull=True, is_hidden=False, test_record=obj).exists(): - raise exceptions.APIException('存在未填写项目') + items_not = TestRecordItem.objects.filter(field_value__isnull=True, is_hidden=False, test_record=obj) + if items_not.exists(): + raise exceptions.APIException('存在未填写项目:'+ ','.join(list(items_not.values_list('form_field__name', flat=True)))) with transaction.atomic(): obj.is_submited=True obj.save()