diff options
Diffstat (limited to 'uploader')
| -rw-r--r-- | uploader/__init__.py | 11 | ||||
| -rw-r--r-- | uploader/configutils.py | 2 | ||||
| -rw-r--r-- | uploader/default_settings.py | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/uploader/__init__.py b/uploader/__init__.py index 32eabba..46689c5 100644 --- a/uploader/__init__.py +++ b/uploader/__init__.py @@ -79,18 +79,19 @@ def __setup_scratch_directory__(app: Flask) -> Flask: return app def __setup_upload_directory__(app: Flask) -> Flask: - if app.config.get("UPLOAD_DIRECTORY", "").strip() == "": - app.config["UPLOAD_DIRECTORY"] = app.config[ + if app.config.get("UPLOADS_DIRECTORY", "").strip() == "": + app.config["UPLOADS_DIRECTORY"] = app.config[ "SCRATCH_DIRECTORY"].joinpath("uploads") else: - app.config["UPLOAD_DIRECTORY"] = Path( - app.config["UPLOAD_DIRECTORY"].strip()).absolute() + app.config["UPLOADS_DIRECTORY"] = Path( + app.config["UPLOADS_DIRECTORY"].strip()).absolute() return app def update_unspecified_defaults(app: Flask) -> Flask: - """Setup the defaults for necessary configurations that do not have values specified for them.""" + """Setup the defaults for necessary configurations that do not have values + specified for them.""" return __setup_upload_directory__(__setup_scratch_directory__(app)) diff --git a/uploader/configutils.py b/uploader/configutils.py index 7cdb8b2..c5db50b 100644 --- a/uploader/configutils.py +++ b/uploader/configutils.py @@ -7,7 +7,7 @@ def fetch_setting(app, setting): def uploads_dir(app) -> Path: """Fetch the uploads directory""" - _dir = Path(fetch_setting(app, "UPLOADS_DIR")).absolute() + _dir = Path(fetch_setting(app, "UPLOADS_DIRECTORY")).absolute() assert _dir.exists() and _dir.is_dir(), ( f"'{_dir}' needs to be an existing directory.") return _dir diff --git a/uploader/default_settings.py b/uploader/default_settings.py index 0ac12e5..6381a67 100644 --- a/uploader/default_settings.py +++ b/uploader/default_settings.py @@ -11,7 +11,7 @@ SECRET_KEY = b"<Please! Please! Please! Change This!>" # We avoid `/tmp` entirely for the scratch directory to avoid shared global # mutable state with other users/applications/processes. SCRATCH_DIRECTORY = "~/tmp/gn-uploader-scratchdir" -UPLOAD_FOLDER = ""# If not set, will be under scratch directory. +UPLOADS_DIRECTORY = ""# If not set, will be under scratch directory. REDIS_URL = "redis://" JOBS_TTL_SECONDS = 1209600 # 14 days |
