Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed dump error after moving format files #1342

Merged
merged 3 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

### Security
-
Expand Down
7 changes: 6 additions & 1 deletion cvat/apps/annotation/serializers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Copyright (C) 2018 Intel Corporation
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

from django.utils import timezone
from rest_framework import serializers

from cvat.apps.annotation import models

class AnnotationDumperSerializer(serializers.ModelSerializer):
Expand Down Expand Up @@ -57,6 +59,9 @@ def create(self, validated_data):
def update(self, instance, validated_data):
dumper_names = [handler["display_name"] for handler in validated_data["annotationdumper_set"]]
loader_names = [handler["display_name"] for handler in validated_data["annotationloader_set"]]
instance.handler_file = validated_data.get('handler_file', instance.handler_file)
instance.owner = validated_data.get('owner', instance.owner)
instance.updated_date = timezone.localtime(timezone.now())

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