is voter missing
This commit is contained in:
13
utils.py
13
utils.py
@@ -155,6 +155,19 @@ def is_show_results(form):
|
||||
return form['show_results']
|
||||
|
||||
|
||||
def is_voter(key, token):
|
||||
if token == None:
|
||||
return False
|
||||
cur = g.db.cursor()
|
||||
cur.execute(
|
||||
"SELECT token FROM tokens WHERE token = ? AND question_set = ? AND role = 'voter'",
|
||||
(
|
||||
get_hash(token),
|
||||
key
|
||||
)
|
||||
)
|
||||
return len(cur.fetchall()) > 0
|
||||
|
||||
def parse_form(key):
|
||||
form = {
|
||||
'expires': None,
|
||||
|
||||
Reference in New Issue
Block a user