diff --git a/CHANGES.rst b/CHANGES.rst index 29642f8b..b42aeed8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ Changelog 3.3.1 (unreleased) ------------------ +- Add a custom to_boolean jinja filter + [kakshay21] + - Adding plone-compile-resources script in addon and extending .gitignore file [kakshay21] diff --git a/bobtemplates/plone/base.py b/bobtemplates/plone/base.py index 64970261..11340fbf 100644 --- a/bobtemplates/plone/base.py +++ b/bobtemplates/plone/base.py @@ -24,10 +24,13 @@ def to_boolean(value): - if value: - return hooks.to_boolean(None, None, value) + if not value: + return + return hooks.to_boolean(None, None, value) +# this is a custom filter which we can use in jinja template. +# see https://github.com/plone/bobtemplates.plone/issues/292 jinja2_env.filters['to_boolean'] = to_boolean