diff options
-rw-r--r-- | askbot/setup_templates/settings.py | 3 | ||||
-rw-r--r-- | askbot/skins/loaders.py | 8 | ||||
-rw-r--r-- | askbot/startup_procedures.py | 13 |
3 files changed, 21 insertions, 3 deletions
diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index feb7a2a2..a97402aa 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -85,7 +85,8 @@ TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', #below is askbot stuff for this tuple - 'askbot.skins.loaders.load_template_source', + #'askbot.skins.loaders.load_template_source', #changed due to bug 97 + 'askbot.skins.loaders.filesystem_load_template_source', #'django.template.loaders.eggs.load_template_source', ) diff --git a/askbot/skins/loaders.py b/askbot/skins/loaders.py index bed1e9da..64d14072 100644 --- a/askbot/skins/loaders.py +++ b/askbot/skins/loaders.py @@ -22,9 +22,11 @@ template.add_to_builtins('askbot.templatetags.extra_filters_jinja') #here it is ignored because it is assumed that we won't use unicode paths ASKBOT_SKIN_COLLECTION_DIR = os.path.dirname(__file__) -def load_template_source(name, dirs=None): +#changed the name from load_template_source +def filesystem_load_template_source(name, dirs=None): """Django template loader """ + if dirs is None: dirs = (ASKBOT_SKIN_COLLECTION_DIR, ) else: @@ -37,7 +39,9 @@ def load_template_source(name, dirs=None): except: tname = os.path.join('default','templates',name) return filesystem.load_template_source(tname,dirs) -load_template_source.is_usable = True +filesystem_load_template_source.is_usable = True +#added this for backward compatbility +load_template_source = filesystem_load_template_source class SkinEnvironment(CoffinEnvironment): """Jinja template environment diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py index cc7f86c0..e8dec45f 100644 --- a/askbot/startup_procedures.py +++ b/askbot/startup_procedures.py @@ -172,12 +172,25 @@ def test_encoding(): 'to the terminal or log files' ) +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: + askbot_warning( + 'In TEMPLATE_LOADERS settings you have an old style ' + 'template loader that throws a Warning on logs ' + 'please change: askbot.skins.loaders.load_template_source ' + 'for: askbot.skins.loaders.filesystem_load_template_source' + ) + def run_startup_tests(): """function that runs all startup tests, mainly checking settings config so far """ #todo: refactor this when another test arrives + test_template_loader() test_encoding() test_modules() test_askbot_url() |