summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-03-10 13:07:29 -0800
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-03-10 13:07:29 -0800
commit475f58cac46939dad7cc288f57ade0aa486d3348 (patch)
treeae54b6a4171fec91349bf18a33aa5e79c502d5ff
parent0f03df88ade0af3e248e2cd4c64b35f34ce87e99 (diff)
parentc053f460611c977bebfcbc472a6a5d7e6e3a75b9 (diff)
downloadaskbot-475f58cac46939dad7cc288f57ade0aa486d3348.tar.gz
askbot-475f58cac46939dad7cc288f57ade0aa486d3348.tar.bz2
askbot-475f58cac46939dad7cc288f57ade0aa486d3348.zip
Merge pull request #56 from MITx/master
Keep startup from breaking on tuples in django_settings.STATICFILES_DIRS
-rw-r--r--askbot/startup_procedures.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 4c76be2c..0ce5b3a1 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -356,7 +356,11 @@ def test_staticfiles():
askbot_root = os.path.dirname(askbot.__file__)
skin_dir = os.path.abspath(os.path.join(askbot_root, 'skins'))
- if skin_dir not in map(os.path.abspath, django_settings.STATICFILES_DIRS):
+
+ # django_settings.STATICFILES_DIRS can have strings or tuples
+ staticfiles_dirs = [d[1] if isinstance(d, tuple) else d
+ for d in django_settings.STATICFILES_DIRS]
+ if skin_dir not in map(os.path.abspath, staticfiles_dirs):
errors.append(
'Add to STATICFILES_DIRS list of your settings.py file:\n'
" '%s'," % skin_dir
@@ -368,7 +372,7 @@ def test_staticfiles():
'Directory specified with settning ASKBOT_EXTRA_SKINS_DIR '
'must exist and contain your custom skins for askbot.'
)
- if extra_skins_dir not in django_settings.STATICFILES_DIRS:
+ if extra_skins_dir not in staticfiles_dirs:
errors.append(
'Add ASKBOT_EXTRA_SKINS_DIR to STATICFILES_DIRS entry in '
'your settings.py file.\n'