From 205186d69021c5a15a92e25423a5f02c5d2b9b98 Mon Sep 17 00:00:00 2001 From: Nikita Manovich Date: Thu, 31 Jan 2019 23:42:37 +0300 Subject: [PATCH] Minor fixes. --- cvat/apps/dashboard/static/dashboard/js/dashboard.js | 3 ++- cvat/apps/engine/models.py | 2 +- cvat/apps/engine/serializers.py | 9 +++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cvat/apps/dashboard/static/dashboard/js/dashboard.js b/cvat/apps/dashboard/static/dashboard/js/dashboard.js index c2656374213d..116fd8d9e362 100644 --- a/cvat/apps/dashboard/static/dashboard/js/dashboard.js +++ b/cvat/apps/dashboard/static/dashboard/js/dashboard.js @@ -510,7 +510,8 @@ function setupTaskCreator() { let taskData = new FormData(); taskData.append("name", name); taskData.append("bug_tracker", bugTrackerLink); - taskData.append("labels", labels); + let labesInfo = new LabelsInfo(labels); + taskData.append("labels[0]", labels); taskData.append("flipped", flipImages); taskData.append("z_order", zOrder); diff --git a/cvat/apps/engine/models.py b/cvat/apps/engine/models.py index e5a38bdad175..692c5677555d 100644 --- a/cvat/apps/engine/models.py +++ b/cvat/apps/engine/models.py @@ -49,7 +49,7 @@ class Task(models.Model): segment_size = models.PositiveIntegerField() z_order = models.BooleanField(default=False) flipped = models.BooleanField(default=False) - image_quality = models.PositiveSmallIntegerField(default=50) + image_quality = models.PositiveSmallIntegerField() # FIXME: remote source field source = SafeCharField(max_length=256, default="unknown") status = models.CharField(max_length=32, choices=StatusChoice.choices(), diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index 862c451614e0..a6699b4c6497 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -80,12 +80,13 @@ class TaskSerializer(serializers.ModelSerializer): labels = LabelSerializer(many=True, source='label_set', partial=True) segments = SegmentSerializer(many=True, source='segment_set', read_only=True) client_files = ClientFileSerializer(many=True, source='clientfile_set', - write_only=True, partial=True) + write_only=True, default=[]) server_files = ServerFileSerializer(many=True, source='serverfile_set', - write_only=True, partial=True) + write_only=True, default=[]) remote_files = RemoteFileSerializer(many=True, source='remotefile_set', - write_only=True, partial=True) - image_quality = serializers.IntegerField(min_value=0, max_value=100) + write_only=True, default=[]) + image_quality = serializers.IntegerField(min_value=0, max_value=100, + default=50) class Meta: model = Task