Fixed issue where add_resource was used regardless of ckan version

This commit is contained in:
Ross Jones 2012-10-23 17:42:04 +01:00
parent f254d1afd7
commit 13a57cd455
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@ class GoogleAnalyticsPlugin(p.SingletonPlugin):
self.track_events = converters.asbool(
config.get('googleanalytics.track_events', False))
p.toolkit.add_resource('fanstatic_library', 'ckanext-googleanalytics')
if not converters.asbool(config.get('ckan.legacy_templates', 'false')):
p.toolkit.add_resource('fanstatic_library', 'ckanext-googleanalytics')
def update_config(self, config):
'''Change the CKAN (Pylons) environment configuration.