diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-11-17 17:57:09 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-11-17 17:57:09 -0300 |
commit | 5b951d7db05a103523eaa9a0729ea0f2909127e8 (patch) | |
tree | 88a13b4a9c6573396016bc444085e1bd8025f4d5 /askbot/startup_procedures.py | |
parent | 8fb693146db9ada774d01ef51691dd3c6d7cc6ab (diff) | |
download | askbot-5b951d7db05a103523eaa9a0729ea0f2909127e8.tar.gz askbot-5b951d7db05a103523eaa9a0729ea0f2909127e8.tar.bz2 askbot-5b951d7db05a103523eaa9a0729ea0f2909127e8.zip |
added django-style template loader class and replaced render_into_skin with render
Diffstat (limited to 'askbot/startup_procedures.py')
-rw-r--r-- | askbot/startup_procedures.py | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py index 957aa14e..acb99b50 100644 --- a/askbot/startup_procedures.py +++ b/askbot/startup_procedures.py @@ -211,14 +211,28 @@ def test_encoding(): def test_template_loader(): """Sends a warning if you have an old style template loader that used to send a warning""" - old_template_loader = 'askbot.skins.loaders.load_template_source' - if old_template_loader in django_settings.TEMPLATE_LOADERS: - raise AskbotConfigError( - "\nPlease change: \n" - "'askbot.skins.loaders.load_template_source', to\n" - "'askbot.skins.loaders.filesystem_load_template_source',\n" - "in the TEMPLATE_LOADERS of your settings.py file" + old_loaders = ( + 'askbot.skins.loaders.load_template_source', + 'askbot.skins.loaders.filesystem_load_template_source', + ) + errors = list() + for loader in old_loaders: + if loader in django_settings.TEMPLATE_LOADERS: + errors.append( + 'remove "%s" from the TEMPLATE_LOADERS setting' % loader + ) + + current_loader = 'askbot.skins.loaders.Loader' + if current_loader not in django_settings.TEMPLATE_LOADERS: + errors.append( + 'add "%s" to the beginning of the TEMPLATE_LOADERS' % current_loader + ) + elif django_settings.TEMPLATE_LOADERS[0] != current_loader: + errors.append( + '"%s" must be the first element of TEMPLATE_LOADERS' % current_loader ) + + print_errors(errors) def test_celery(): """Tests celery settings @@ -458,7 +472,6 @@ def test_staticfiles(): ' python manage.py collectstatic\n' ) - print_errors(errors) if django_settings.STATICFILES_STORAGE == \ 'django.contrib.staticfiles.storage.StaticFilesStorage': |