Skip to content

Commit be2ec3a

Browse files
authored
fixed dump error after moving format files (#1342)
* fixed dump error after moving format files * updated changelog
1 parent ae7dc9c commit be2ec3a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
### Fixed
2323
- New shape is added when press ``esc`` when drawing instead of cancellation
24+
- Fixed `FileNotFoundError` during dump after moving format files
2425

2526
### Security
2627
-

cvat/apps/annotation/serializers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Copyright (C) 2018 Intel Corporation
1+
# Copyright (C) 2018-2020 Intel Corporation
22
#
33
# SPDX-License-Identifier: MIT
44

5+
from django.utils import timezone
56
from rest_framework import serializers
7+
68
from cvat.apps.annotation import models
79

810
class AnnotationDumperSerializer(serializers.ModelSerializer):
@@ -57,6 +59,9 @@ def create(self, validated_data):
5759
def update(self, instance, validated_data):
5860
dumper_names = [handler["display_name"] for handler in validated_data["annotationdumper_set"]]
5961
loader_names = [handler["display_name"] for handler in validated_data["annotationloader_set"]]
62+
instance.handler_file = validated_data.get('handler_file', instance.handler_file)
63+
instance.owner = validated_data.get('owner', instance.owner)
64+
instance.updated_date = timezone.localtime(timezone.now())
6065

6166
handlers_to_delete = [d for d in instance.annotationdumper_set.all() if d.display_name not in dumper_names] + \
6267
[l for l in instance.annotationloader_set.all() if l.display_name not in loader_names]

0 commit comments

Comments
 (0)