Skip to content

Commit

Permalink
Merge pull request #121 from josenaka/pr
Browse files Browse the repository at this point in the history
TEMPLATE_DEBUG has been deprecated in django 1.8
  • Loading branch information
leplatrem committed Nov 5, 2015
2 parents c53f303 + 971471f commit 29a9323
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion leaflet/templatetags/leaflet_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ def leaflet_js(plugins=None):
plugin_names = _get_plugin_names(plugins)
with_forms = PLUGIN_FORMS in plugin_names or PLUGIN_ALL in plugin_names
FORCE_IMAGE_PATH = app_settings.get('FORCE_IMAGE_PATH')

if hasattr(settings, 'TEMPLATE_DEBUG'):
debug = settings.TEMPLATE_DEBUG
elif 'debug' in settings.TEMPLATES[0]['OPTIONS']:
debug = settings.TEMPLATES[0]['OPTIONS']['debug']
else:
debug = False

return {
"DEBUG": settings.TEMPLATE_DEBUG,
"DEBUG": debug,
"SRID": str(SRID) if SRID else None,
"PLUGINS_JS": _get_all_resources_for_plugins(plugin_names, 'js'),
"with_forms": with_forms,
Expand Down

0 comments on commit 29a9323

Please sign in to comment.