Only load DATA_DIR subdirs if DATA_DIR exists (so not during tests)

This commit is contained in:
David Ormsbee
2012-07-10 13:56:51 -04:00
parent fdd9663699
commit 2f90b27707

View File

@@ -176,12 +176,14 @@ STATICFILES_DIRS = [
PROJECT_ROOT / "static",
ASKBOT_ROOT / "askbot" / "skins",
] + [
# 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):
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)
]
# Locale/Internationalization
TIME_ZONE = 'America/New_York' # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name