From 41dae13d44699f23a8861d7fcb8e42c9743cbb0f Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 26 Jul 2018 15:14:04 -0400 Subject: [PATCH] StrictUndefined + empty poll options issue fixed --- anonkun.py | 2 +- templates/quest.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/anonkun.py b/anonkun.py index e60eeb5..acfb8cc 100644 --- a/anonkun.py +++ b/anonkun.py @@ -59,7 +59,7 @@ app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 app.config['SESSION_TYPE'] = 'filesystem' app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True -#app.jinja_env.undefined = "StrictUndefined" +app.jinja_env.undefined = "StrictUndefined" Session(app) socketio.init_app(app) paranoid = Paranoid(app) diff --git a/templates/quest.html b/templates/quest.html index f401c2f..e74bf7d 100644 --- a/templates/quest.html +++ b/templates/quest.html @@ -69,14 +69,14 @@ - {% for option in options[quest_post[0]] %} + {% for option in options.get(quest_post[0], []) %} - + {{ option[2] }} - {{ poll_votes[option[0]]|length }} + {{ poll_votes.get(option[0], [])|length }} {% endfor %}