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()