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.
This commit is contained in:
Guruprasad Lakshmi Narayanan
2018-08-30 22:00:42 +05:30
parent 4a1caf6c03
commit a21d9bf381
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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'],