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):
|
||||
mtask = attrs.get('mtask', None)
|
||||
if mtask:
|
||||
handle_date = attrs['handle_date']
|
||||
if handle_date >= mtask.start_date and handle_date <= mtask.end_date:
|
||||
pass
|
||||
else:
|
||||
raise ValidationError('操作日期错误')
|
||||
attrs['handle_date'] = mtask.start_date
|
||||
if mtask.state != Mtask.MTASK_ASSGINED:
|
||||
raise ValidationError(f'{mtask.mgroup.name}_不可提交日志!')
|
||||
return attrs
|
||||
|
|
|
|||
Loading…
Reference in New Issue