From b40863f1a30a754f10531ecd119ab2795998cb45 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Mon, 30 Nov 2020 14:40:34 +0300 Subject: [PATCH] updated changelog --- CHANGELOG.md | 1 + cvat/apps/engine/views.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 987b5f11..82897f74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reset zoom option doesn't work in tag annotation mode () - Canvas is busy error () - Projects view layout fix () +- Fixed the tasks view (infinite loading) when it is impossible to get a preview of the task () ### Security diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index aec2f88a..e6d1745e 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -426,15 +426,15 @@ class TaskViewSet(auth.TaskGetQuerySetMixin, viewsets.ModelViewSet): possible_data_type_values = ('chunk', 'frame', 'preview') possible_quality_values = ('compressed', 'original') - if not data_type or data_type not in possible_data_type_values: - raise ValidationError(detail='Data type not specified or has wrong value') - elif data_type == 'chunk' or data_type == 'frame': - if not data_id: - raise ValidationError(detail='Number not specified') - elif data_quality not in possible_quality_values: - raise ValidationError(detail='Wrong quality value') - try: + if not data_type or data_type not in possible_data_type_values: + raise ValidationError(detail='Data type not specified or has wrong value') + elif data_type == 'chunk' or data_type == 'frame': + if not data_id: + raise ValidationError(detail='Number is not specified') + elif data_quality not in possible_quality_values: + raise ValidationError(detail='Wrong quality value') + db_task = self.get_object() db_data = db_task.data if not db_data: