Skip to content

Commit

Permalink
Merge pull request #293 from plone/akshay-fixup
Browse files Browse the repository at this point in the history
Update CHANGES.rst
  • Loading branch information
MrTango committed Jun 27, 2018
2 parents f00861b + 7bcc323 commit 750cbf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
7 changes: 5 additions & 2 deletions bobtemplates/plone/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 750cbf5

Please sign in to comment.