API - return error when number of files in zip exceeds limit

(instead of importing the configured number of files without raising errors)
This commit is contained in:
Sam
2022-11-04 22:26:47 +01:00
parent da5f7d12e7
commit 4b1c51880f
3 changed files with 25 additions and 18 deletions

View File

@@ -1022,7 +1022,7 @@ def post_workout(auth_user: User) -> Union[Tuple[Dict, int], HttpResponse]:
appLog.error(e.e)
if e.status == 'error':
return InternalServerErrorResponse(e.message)
return InvalidPayloadErrorResponse(e.message)
return InvalidPayloadErrorResponse(e.message, e.status)
shutil.rmtree(folders['extract_dir'], ignore_errors=True)
shutil.rmtree(folders['tmp_dir'], ignore_errors=True)