From 52820ff51a39792e5191990f0125af88821a404d Mon Sep 17 00:00:00 2001 From: shonenada Date: Fri, 22 Feb 2019 15:44:18 +0800 Subject: [PATCH] fix: fix typo --- stalls/modules/poll/api.py | 4 ++-- stalls/modules/poll/form/result.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/stalls/modules/poll/api.py b/stalls/modules/poll/api.py index cc7533b..d1965d0 100644 --- a/stalls/modules/poll/api.py +++ b/stalls/modules/poll/api.py @@ -137,7 +137,7 @@ def do_poll(): response = process_vote(payload) if response is None: logging.getLogger('poll').info('none respond') - return json_response(form.make_msg(_('Operation Failed'))) + return json_response(form.make_msg(_('Action Not Found'))) return json_response(response) @@ -177,4 +177,4 @@ def show_poll_result(): else: return json_response(form.make_msg(_('Poll Not Found'))) - return json_response(form.make_msg(_('Operation Failed'))) + return json_response(form.make_msg(_('Action Not Foudn'))) diff --git a/stalls/modules/poll/form/result.py b/stalls/modules/poll/form/result.py index ef65539..da2d794 100644 --- a/stalls/modules/poll/form/result.py +++ b/stalls/modules/poll/form/result.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import time + from flask import url_for from flask_babel import gettext as _ @@ -88,7 +90,7 @@ def show_poll_result(poll): form.add_actions( context, - Input(value=poll.visit_key, name='token'), + Input(value=poll.visit_key, name='token', hidden=True), Section(value=_('Poll Name: %(description)s', description=poll.description)), @@ -112,10 +114,11 @@ def show_poll_result(poll): image_url = url_for('poll.preview_poll', poll_id=poll.id, token=poll.visit_key, + ts=time.time(), _external=True) form.add_actions( Image(title=_('Poll Result'), url=image_url), - Submit(name=submit.REFRESH, label=_('Refresh'))) + Submit(name=submit.REFRESH, text=_('Refresh'))) return form.render()