fix: batchst create bug
This commit is contained in:
parent
9780cd8021
commit
f57604492b
|
@ -589,13 +589,11 @@ class BatchSt(BaseModel):
|
||||||
"""
|
"""
|
||||||
创建新的批次
|
创建新的批次
|
||||||
"""
|
"""
|
||||||
try:
|
if BatchSt.objects.filter(batch=batch).exists():
|
||||||
BatchSt.objects.get(batch=batch)
|
raise ParseError(f"{batch} 该批号已存在不可用")
|
||||||
raise ParseError(f"{batch} 该批号不可使用")
|
if mio is None and handover is None and mlog is None:
|
||||||
except BatchSt.DoesNotExist:
|
raise ParseError("mio or handover or mlog must be provided")
|
||||||
if mio is None and handover is None and mlog is None:
|
BatchSt.objects.create(batch=batch, mio=mio, handover=handover, mlog=mlog)
|
||||||
raise ParseError("mio or handover or mlog must be provided")
|
|
||||||
BatchSt.objects.create(batch=batch, mio=mio, handover=handover, mlog=mlog)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue