diff options
author | Joe Robinson <joe@mumsnet.com> | 2014-07-25 15:41:58 +0100 |
---|---|---|
committer | Joe Robinson <joe@mumsnet.com> | 2014-07-25 15:41:58 +0100 |
commit | 07884e5c9b4fe423d10b1f4a9b6366f7d81cffb2 (patch) | |
tree | 02ad9caed8e5b5fe251d92bac53e2dbc639ddefd /option.go | |
parent | bf720d0d1ae4e9e20e34bd63c45252468b6fdd6c (diff) |
Fixed voting to only vote for options for the given poll
Diffstat (limited to 'option.go')
-rw-r--r-- | option.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -10,10 +10,10 @@ type Option struct { numVotes int64 } -func getOptionFromText(db*sqlite3.Conn, text string) (Option, error) { +func getOptionFromText(db*sqlite3.Conn, text string, id int) (Option, error) { - args := sqlite3.NamedArgs{"$a": text} - sql := "SELECT * FROM options WHERE text = $a" + args := sqlite3.NamedArgs{"$a": text, "$b": id} + sql := "SELECT * FROM options WHERE text = $a and poll_id = $b" s, err := db.Query(sql, args) row := make(sqlite3.RowMap) |