feat: mlog提交时如有mtask则handle_date为mtask日期
This commit is contained in:
parent
a9c16c4a9d
commit
6182ef3c58
|
|
@ -279,11 +279,7 @@ class MlogSerializer(CustomModelSerializer):
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
mtask = attrs.get('mtask', None)
|
mtask = attrs.get('mtask', None)
|
||||||
if mtask:
|
if mtask:
|
||||||
handle_date = attrs['handle_date']
|
attrs['handle_date'] = mtask.start_date
|
||||||
if handle_date >= mtask.start_date and handle_date <= mtask.end_date:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise ValidationError('操作日期错误')
|
|
||||||
if mtask.state != Mtask.MTASK_ASSGINED:
|
if mtask.state != Mtask.MTASK_ASSGINED:
|
||||||
raise ValidationError(f'{mtask.mgroup.name}_不可提交日志!')
|
raise ValidationError(f'{mtask.mgroup.name}_不可提交日志!')
|
||||||
return attrs
|
return attrs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue