diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 2f20ddad..4e3c1401 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -107,8 +107,8 @@ class MlogSerializer(CustomModelSerializer): material_out = validated_data['material_out'] if not (mgroup and material_out): raise ValidationError('缺少工段或产物!') - if not WMaterial.objects.filter(batch=batch).exists(): - raise ValidationError('批次号不存在') + if not WMaterial.objects.filter(batch=batch).exists(): + raise ValidationError('批次号不存在') if Mlog.objects.filter(mtask=mtask, batch=batch, handle_date=handle_date, handle_user=handle_user).exists(): raise ValidationError('存在相同的日志记录') return super().create(validated_data)