add util.get_vote -> get_vote Jinja2 filter

This filter gets a vote of a request's user toward a voteinfo.

Example: {% set vote = (voteinfo | get_vote(request)) %}

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-19 10:46:44 -07:00
parent d606ebc0f1
commit a6bba601a9
2 changed files with 8 additions and 0 deletions

View file

@ -29,6 +29,7 @@ env.filters["dt"] = util.timestamp_to_datetime
env.filters["as_timezone"] = util.as_timezone
env.filters["dedupe_qs"] = util.dedupe_qs
env.filters["urlencode"] = quote_plus
env.filters["get_vote"] = util.get_vote
# Add captcha filters.
env.filters["captcha_salt"] = captcha.captcha_salt_filter