fix: handover update validate更严谨一些
This commit is contained in:
parent
e954b37404
commit
8c43f8ec62
|
|
@ -310,6 +310,9 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
def validate(self, attrs):
|
||||
if attrs.get('mlog', None):
|
||||
attrs['send_mgroup'] = attrs['mlog'].mgroup
|
||||
attrs['send_dept'] = attrs['mlog'].mgroup.belong_dept
|
||||
elif attrs.get('wm', None):
|
||||
attrs['send_dept'] = attrs['wm'].belong_dept
|
||||
return super().validate(attrs)
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Loading…
Reference in New Issue