feat: 去除 handle_date的日期校验

This commit is contained in:
caoqianming 2024-09-05 09:35:54 +08:00
parent 00853f395d
commit 0de377ddc4
1 changed files with 7 additions and 7 deletions

View File

@ -396,13 +396,13 @@ class MlogSerializer(CustomModelSerializer):
attrs['handle_date'] = attrs['work_end_time'].date()
elif attrs['work_start_time']:
attrs['handle_date'] = attrs['work_start_time'].date()
if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
pass
else:
if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
pass
else:
raise ValidationError('操作日期错误')
# if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
# pass
# else:
# if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
# pass
# else:
# raise ValidationError('操作日期错误')
return attrs