Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
3e336237
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e336237
编写于
11月 30, 2020
作者:
A
Andrey Zhavoronkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed getTaskPreview exception handling, slightly improved the backend exception handling
上级
c4662fa4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
6 deletion
+9
-6
cvat-ui/src/actions/tasks-actions.ts
cvat-ui/src/actions/tasks-actions.ts
+1
-1
cvat/apps/engine/views.py
cvat/apps/engine/views.py
+8
-5
未找到文件。
cvat-ui/src/actions/tasks-actions.ts
浏览文件 @
3e336237
...
...
@@ -93,7 +93,7 @@ export function getTasksAsync(query: TasksQuery): ThunkAction<Promise<void>, {},
}
const
array
=
Array
.
from
(
result
);
const
promises
=
array
.
map
((
task
):
string
=>
(
task
as
any
).
frames
.
preview
().
catch
(
''
));
const
promises
=
array
.
map
((
task
):
string
=>
(
task
as
any
).
frames
.
preview
().
catch
(
()
=>
''
));
dispatch
(
getInferenceStatusAsync
());
...
...
cvat/apps/engine/views.py
浏览文件 @
3e336237
...
...
@@ -25,7 +25,7 @@ from drf_yasg.inspectors import CoreAPICompatInspector, NotHandled
from
drf_yasg.utils
import
swagger_auto_schema
from
rest_framework
import
mixins
,
serializers
,
status
,
viewsets
from
rest_framework.decorators
import
action
from
rest_framework.exceptions
import
APIException
from
rest_framework.exceptions
import
APIException
,
NotFound
,
ValidationError
from
rest_framework.permissions
import
SAFE_METHODS
,
IsAuthenticated
from
rest_framework.renderers
import
JSONRenderer
from
rest_framework.response
import
Response
...
...
@@ -427,16 +427,19 @@ class TaskViewSet(auth.TaskGetQuerySetMixin, viewsets.ModelViewSet):
possible_quality_values
=
(
'compressed'
,
'original'
)
if
not
data_type
or
data_type
not
in
possible_data_type_values
:
r
eturn
Response
(
data
=
'data type not specified or has wrong value'
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
r
aise
ValidationError
(
detail
=
'Data type not specified or has wrong value'
)
elif
data_type
==
'chunk'
or
data_type
==
'frame'
:
if
not
data_id
:
r
eturn
Response
(
data
=
'number not specified'
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
r
aise
ValidationError
(
detail
=
'Number not specified'
)
elif
data_quality
not
in
possible_quality_values
:
r
eturn
Response
(
data
=
'wrong quality value'
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
r
aise
ValidationError
(
detail
=
'Wrong quality value'
)
try
:
db_task
=
self
.
get_object
()
db_data
=
db_task
.
data
if
not
db_data
:
raise
NotFound
(
detail
=
'Cannot find requested data for the task'
)
frame_provider
=
FrameProvider
(
db_task
.
data
)
if
data_type
==
'chunk'
:
...
...
@@ -468,7 +471,7 @@ class TaskViewSet(auth.TaskGetQuerySetMixin, viewsets.ModelViewSet):
else
:
return
Response
(
data
=
'unknown data type {}.'
.
format
(
data_type
),
status
=
status
.
HTTP_400_BAD_REQUEST
)
except
APIException
as
e
:
return
Response
(
data
=
e
.
default_detail
,
status
=
e
.
status_code
)
return
Response
(
data
=
e
.
get_full_details
()
,
status
=
e
.
status_code
)
except
Exception
as
e
:
msg
=
'cannot get requested data type: {}, number: {}, quality: {}'
.
format
(
data_type
,
data_id
,
data_quality
)
slogger
.
task
[
pk
].
error
(
msg
,
exc_info
=
True
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录