diff --git a/lms/envs/common.py b/lms/envs/common.py index ce08bf9666..61a3abab6d 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -260,12 +260,22 @@ STATICFILES_DIRS = [ PROJECT_ROOT / "askbot" / "skins", ] if os.path.isdir(DATA_DIR): + # Add the full course repo if there is no static directory STATICFILES_DIRS += [ # TODO (cpennington): When courses are stored in a database, this # should no longer be added to STATICFILES (course_dir, DATA_DIR / course_dir) for course_dir in os.listdir(DATA_DIR) - if os.path.isdir(DATA_DIR / course_dir) + if (os.path.isdir(DATA_DIR / course_dir) and + not os.path.isdir(DATA_DIR / course_dir / 'static')) + ] + # Otherwise, add only the static directory from the course dir + STATICFILES_DIRS += [ + # TODO (cpennington): When courses are stored in a database, this + # should no longer be added to STATICFILES + (course_dir, DATA_DIR / course_dir / 'static') + for course_dir in os.listdir(DATA_DIR) + if (os.path.isdir(DATA_DIR / course_dir / 'static')) ] # Locale/Internationalization