feat: 拦截new_batch的错误

This commit is contained in:
caoqianming 2025-11-13 10:31:16 +08:00
parent 8943443e24
commit 164f3f16bb
1 changed files with 2 additions and 0 deletions

View File

@ -1208,6 +1208,8 @@ class HandoverSerializer(CustomModelSerializer):
new_defect = new_wm.defect
if not attrs.get("new_batch", None):
raise ParseError("必须指定合并后的批次")
if 'undefined' in attrs['new_batch'] or 'null' in attrs['new_batch']:
raise ParseError("新批次号错误!")
wm:WMaterial = attrs.get('wm', None)