diff --git a/seahub/api2/endpoints/query_zip_progress.py b/seahub/api2/endpoints/query_zip_progress.py index 06b7b48f32..0a7205dcad 100644 --- a/seahub/api2/endpoints/query_zip_progress.py +++ b/seahub/api2/endpoints/query_zip_progress.py @@ -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))