fix: handover serializer validate bug
This commit is contained in:
parent
8872d63aae
commit
6754b668bc
|
@ -309,6 +309,9 @@ class MlogSerializer(CustomModelSerializer):
|
|||
return attrs
|
||||
|
||||
|
||||
class MlogInitSerializer(CustomModelSerializer):
|
||||
pass
|
||||
|
||||
class MlogRevertSerializer(serializers.Serializer):
|
||||
change_reason = serializers.CharField(label='撤回原因')
|
||||
|
||||
|
@ -345,6 +348,7 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
attrs['send_dept'] = attrs['wm'].belong_dept
|
||||
if attrs['wm'].mgroup:
|
||||
attrs['send_mgroup'] = attrs['wm'].mgroup
|
||||
material = attrs['material']
|
||||
if material.process and material.process.into_wm_mgroup and 'recive_mgroup' not in attrs:
|
||||
raise ValidationError('必须指定交接工段')
|
||||
if 'recive_mgroup' in attrs and attrs['recive_mgroup']:
|
||||
|
|
Loading…
Reference in New Issue