fix: handle_date使用localdate获取日期
This commit is contained in:
parent
96ba8c8223
commit
a6fadedee2
|
|
@ -425,16 +425,9 @@ class MlogSerializer(CustomModelSerializer):
|
|||
attrs['handle_date'] = mtask.start_date
|
||||
else:
|
||||
if attrs['work_end_time']:
|
||||
attrs['handle_date'] = attrs['work_end_time'].date()
|
||||
attrs['handle_date'] = localdate(attrs['work_end_time'])
|
||||
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('操作日期错误')
|
||||
attrs['handle_date'] = localdate(attrs['work_start_time'])
|
||||
mtaskb: Mtaskb = attrs.get('mtaskb', None)
|
||||
if mtaskb:
|
||||
mtask = mtaskb.mtask
|
||||
|
|
|
|||
Loading…
Reference in New Issue