From 108d986e2a977f9b6bf7a283fa5be2bfeb784723 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 1 Apr 2020 15:10:07 +0300 Subject: [PATCH] fixed dump error after moving format files --- cvat/apps/annotation/serializers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cvat/apps/annotation/serializers.py b/cvat/apps/annotation/serializers.py index 8fa8b3455303..7284c0414a00 100644 --- a/cvat/apps/annotation/serializers.py +++ b/cvat/apps/annotation/serializers.py @@ -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): @@ -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]