feat: 按个选入消耗时统计mlog数据优化2
This commit is contained in:
parent
45647d2149
commit
05ebb25dc7
|
@ -808,12 +808,17 @@ class MlogbwViewSet(CustomModelViewSet):
|
|||
@transaction.atomic
|
||||
def perform_create(self, serializer):
|
||||
ins:Mlogbw = serializer.save()
|
||||
mlog = ins.mlogb.mlog
|
||||
mlog:Mlog = None
|
||||
if isinstance(ins, list):
|
||||
insx = ins
|
||||
else:
|
||||
insx = [ins]
|
||||
for ins in insx:
|
||||
if mlog is None:
|
||||
mlog = ins.mlogb.mlog
|
||||
else:
|
||||
if mlog != ins.mlogb.mlog:
|
||||
raise ParseError("所有记录必须属于同一张日志")
|
||||
route:Route = ins.mlogb.route
|
||||
mlogb:Mlogb = ins.mlogb
|
||||
Mlogbw.cal_count_notok(mlogb)
|
||||
|
|
Loading…
Reference in New Issue