feat: 可根据work_start_time 推出handle_date

This commit is contained in:
caoqianming 2025-08-19 10:39:46 +08:00
parent a8ed1c3083
commit d9326bc264
1 changed files with 4 additions and 4 deletions

View File

@ -686,10 +686,10 @@ class MlogChangeSerializer(CustomModelSerializer):
model = Mlog
fields = ['id', 'work_end_time', 'handle_user', 'note', 'oinfo_json', 'test_file', 'test_user', 'test_time', 'equipment', "team"]
def validate(self, attrs):
if attrs.get('work_end_time', None):
attrs['handle_date'] = localdate(attrs['work_end_time'])
return attrs
# def validate(self, attrs):
# if attrs.get('work_end_time', None):
# attrs['handle_date'] = localdate(attrs['work_end_time'])
# return attrs
class CountJsonSerializer(serializers.Serializer):