Finish support for multiple answers polls

This commit is contained in:
Thomas Sileo
2019-08-15 14:47:41 +02:00
parent c125891681
commit 49ffe3ab75
7 changed files with 67 additions and 38 deletions

View File

@@ -206,6 +206,11 @@ def get_actor(url):
return f"Error<{url}/{exc!r}>"
@filters.app_template_filter()
def poll_answer_key(choice: str) -> str:
return _answer_key(choice)
@filters.app_template_filter()
def get_answer_count(choice, obj, meta):
count_from_meta = meta.get("question_answers", {}).get(_answer_key(choice), 0)