From a21d9bf381f59ccb8c02e3071e2b842147c5ce05 Mon Sep 17 00:00:00 2001 From: Guruprasad Lakshmi Narayanan Date: Thu, 30 Aug 2018 22:00:42 +0530 Subject: [PATCH] Convert DATA_DIR to a Path object when fetching from ENV_TOKENS This fixes the exceptions raised by code that expects it to be a Path object. For instance, the LMS sysadmin dashboard courses page expects DATA_DIR to be a Path object and throws a 500 Internal Server error if it isn't. --- cms/envs/aws.py | 2 +- lms/envs/aws.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 2f62502819..f2259ef5e9 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -154,7 +154,7 @@ ALLOWED_HOSTS = [ ] LOG_DIR = ENV_TOKENS['LOG_DIR'] -DATA_DIR = ENV_TOKENS.get('DATA_DIR', DATA_DIR) +DATA_DIR = path(ENV_TOKENS.get('DATA_DIR', DATA_DIR)) CACHES = ENV_TOKENS['CACHES'] # Cache used for location mapping -- called many times with the same key/value diff --git a/lms/envs/aws.py b/lms/envs/aws.py index fbd8e53fcb..06282d3bc0 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -324,7 +324,7 @@ WIKI_ENABLED = ENV_TOKENS.get('WIKI_ENABLED', WIKI_ENABLED) local_loglevel = ENV_TOKENS.get('LOCAL_LOGLEVEL', 'INFO') LOG_DIR = ENV_TOKENS['LOG_DIR'] -DATA_DIR = ENV_TOKENS.get('DATA_DIR', DATA_DIR) +DATA_DIR = path(ENV_TOKENS.get('DATA_DIR', DATA_DIR)) LOGGING = get_logger_config(LOG_DIR, logging_env=ENV_TOKENS['LOGGING_ENV'],