fix: mlog change 导致的bug问题
This commit is contained in:
parent
839fc2af82
commit
448bdb9ee6
|
@ -325,9 +325,11 @@ class MlogViewSet(CustomModelViewSet):
|
|||
修改日志
|
||||
"""
|
||||
ins = self.get_object()
|
||||
if ins.submit_time is not None:
|
||||
raise ParseError('该日志已提交!')
|
||||
if ins.ticket and ins.ticket.state != State.STATE_TYPE_START:
|
||||
raise ParseError('该日志在审批中不可修改!')
|
||||
sr = MlogChangeSerializer(instance=ins, data=request.data)
|
||||
sr = MlogChangeSerializer(instance=ins, data=request.data, partial=True)
|
||||
sr.is_valid(raise_exception=True)
|
||||
sr.save()
|
||||
return Response(MlogSerializer(ins).data)
|
||||
|
|
Loading…
Reference in New Issue