diff --git a/course_discovery/settings/production.py b/course_discovery/settings/production.py index 93d45a43f4..bb2c408853 100644 --- a/course_discovery/settings/production.py +++ b/course_discovery/settings/production.py @@ -89,5 +89,8 @@ # Have images and such that we upload be publicly readable AWS_DEFAULT_ACL = 'public-read' -# Convert dict keys to lowercase -GOOGLE_SERVICE_ACCOUNT_CREDENTIALS = {k.lower(): v for k, v in GOOGLE_SERVICE_ACCOUNT_CREDENTIALS.items()} +# Convert dict keys to lowercase. The if condition replaces \\n in private_key value with \n. +GOOGLE_SERVICE_ACCOUNT_CREDENTIALS = { + k.lower(): (v.replace("\\n", "\n") if k.lower() == "private_key" else v) + for (k, v) in GOOGLE_SERVICE_ACCOUNT_CREDENTIALS.items() +}