diff --git a/changelog.d/20231007_153252_fateme.khodayari97.md b/changelog.d/20231007_153252_fateme.khodayari97.md new file mode 100644 index 0000000..5bd3333 --- /dev/null +++ b/changelog.d/20231007_153252_fateme.khodayari97.md @@ -0,0 +1,2 @@ +- [Bugfix] Fix ORA2 file uploads in CMS. As the cache settings are shared between CMS and LMS, the settings are moved +from `common_lms.py` to `common_all.py`. (by @FatemeKhodayari) diff --git a/tutor/templates/apps/openedx/settings/partials/common_all.py b/tutor/templates/apps/openedx/settings/partials/common_all.py index b02cff4..b1d5a9f 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_all.py +++ b/tutor/templates/apps/openedx/settings/partials/common_all.py @@ -77,6 +77,11 @@ CACHES = { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", }, + "ora2-storage": { + "KEY_PREFIX": "ora2-storage", + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + } } # The default Django contrib site is the one associated to the LMS domain name. 1 is diff --git a/tutor/templates/apps/openedx/settings/partials/common_cms.py b/tutor/templates/apps/openedx/settings/partials/common_cms.py index 567cb0c..1b2f48a 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_cms.py +++ b/tutor/templates/apps/openedx/settings/partials/common_cms.py @@ -21,7 +21,7 @@ FRONTEND_LOGIN_URL = LMS_ROOT_URL + '/login' FRONTEND_REGISTER_URL = LMS_ROOT_URL + '/register' # Create folders if necessary -for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]: +for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE, ORA2_FILEUPLOAD_ROOT]: if not os.path.exists(folder): os.makedirs(folder, exist_ok=True) diff --git a/tutor/templates/apps/openedx/settings/partials/common_lms.py b/tutor/templates/apps/openedx/settings/partials/common_lms.py index 84dfd66..e3b8649 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_lms.py +++ b/tutor/templates/apps/openedx/settings/partials/common_lms.py @@ -36,11 +36,6 @@ CACHES["staticfiles"] = { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATION": "staticfiles_lms", } -CACHES["ora2-storage"] = { - "KEY_PREFIX": "ora2-storage", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", -} # Create folders if necessary for folder in [DATA_DIR, LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE, ORA2_FILEUPLOAD_ROOT]: