If cookie value already exists, then don't let a vote happen
This commit is contained in:
parent
b790b733ea
commit
f9aa709a4b
@ -236,6 +236,9 @@ def hkfcD_vote_thanks():
|
||||
if _motm and _dotd and request.method == 'POST':
|
||||
prev_identity = request.cookies.get('sessionID')
|
||||
warn(prev_identity)
|
||||
if prev_identity:
|
||||
warn("Naughty, naughty, you've already voted!")
|
||||
else:
|
||||
identity = randomUrlSuffix(8)
|
||||
id_commit = "INSERT INTO motmSessions (sessionID) VALUES ('" + identity + "')"
|
||||
sql_write(id_commit)
|
||||
@ -246,7 +249,7 @@ def hkfcD_vote_thanks():
|
||||
elif _comments == "Optional comments added here":
|
||||
print("No comment")
|
||||
else:
|
||||
### The matchDate has been replaced with the matchNumber - this should be corrected at some point (via a fixture table lookup)
|
||||
### The matchDate has been replaced with the matchNumber - this should be corrected at some point (via a fixture table lookup)
|
||||
sql3 = "INSERT INTO _motmComments (_matchDate, opposition, comment) VALUES ('" + _matchDate + "', '" + _oppo + "', '" + _fixed_comments + "')"
|
||||
#sql_write(sql3)
|
||||
#sql_write(sql)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user