feat: mlog 支持handle_user 默认create_by
This commit is contained in:
parent
5533cc6967
commit
a69f718859
|
@ -469,6 +469,9 @@ class MlogSerializer(CustomModelSerializer):
|
||||||
material_out = attrs['material_out']
|
material_out = attrs['material_out']
|
||||||
if not (mgroup and material_out):
|
if not (mgroup and material_out):
|
||||||
raise ValidationError('缺少工段或产物!')
|
raise ValidationError('缺少工段或产物!')
|
||||||
|
handle_user = attrs.get('handle_user', None)
|
||||||
|
if handle_user is None and hasattr(self, "request"):
|
||||||
|
handle_user = self.request.user
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue