Remove useless intermediary variable in elections.go
This commit is contained in:
@ -77,15 +77,12 @@ func (e *ElectionModel) GetById(id int) (*Election, error) {
|
||||
row := e.DB.QueryRow(query, id)
|
||||
|
||||
election := &Election{}
|
||||
var areVotersKnown int
|
||||
|
||||
err := row.Scan(&election.ID, &election.Name, &election.Tokens, &areVotersKnown, &election.MaxVoters, &election.CreatedAt, &election.ExpiresAt)
|
||||
err := row.Scan(&election.ID, &election.Name, &election.Tokens, &election.AreVotersKnown, &election.MaxVoters, &election.CreatedAt, &election.ExpiresAt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
election.AreVotersKnown = areVotersKnown == 1
|
||||
|
||||
// Retrieve choices for the election
|
||||
queryChoices := `
|
||||
SELECT text
|
||||
|
Reference in New Issue
Block a user