diff --git a/backend/aiproject/settings.py b/backend/aiproject/settings.py index 481231ad..a37d0884 100644 --- a/backend/aiproject/settings.py +++ b/backend/aiproject/settings.py @@ -56,6 +56,7 @@ # Limiter EPOCHS_LIMIT = env("EPOCHS_LIMIT", default=30) BATCH_SIZE_LIMIT = env("BATCH_SIZE_LIMIT", default=8) +TRAINING_WORKSPACE_DOWNLOAD_LIMIT = env("TRAINING_WORKSPACE_DOWNLOAD_LIMIT", default=200) # Application definition diff --git a/backend/core/views.py b/backend/core/views.py index 388de0fb..082360dd 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -689,9 +689,9 @@ def get(self, request, lookup_dir): if os.path.isdir(base_dir) else os.path.getsize(base_dir) ) / (1024**2) - if size > 200: # if file is greater than 200 mb exit + if size > settings.TRAINING_WORKSPACE_DOWNLOAD_LIMIT: # if file is greater than 200 mb exit return Response( - {f"Errr: File Size {size} MB Exceed More than 200 MB"}, status=403 + {f"Errr: File Size {size} MB Exceed More than {settings.TRAINING_WORKSPACE_DOWNLOAD_LIMIT} MB"}, status=403 ) if os.path.isfile(base_dir):