1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-13 15:05:30 +00:00

return 404 when can not get progress

This commit is contained in:
lian 2022-04-28 18:15:47 +08:00
parent 6a688db352
commit 0726bae454

View File

@ -13,6 +13,7 @@ from seaserv import seafile_api
logger = logging.getLogger(__name__)
class QueryZipProgressView(APIView):
throttle_classes = (UserRateThrottle, )
@ -35,4 +36,8 @@ class QueryZipProgressView(APIView):
error_msg = 'Internal Server Error'
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
if not progress:
error_msg = 'progress not found.'
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
return Response(json.loads(progress))