diff --git a/.DS_Store b/.DS_Store index 5008ddf..f5fccd3 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 9ce101a..bc6c8a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /app/uploads -/app/.env -/app/tmp/ /app/Example_code + +app/tmp/*.log +app/tmp/* +*.env diff --git a/app/internal/handlers/volunteer_poll.go b/app/internal/handlers/volunteer_poll.go index 441e23e..d8d53c8 100644 --- a/app/internal/handlers/volunteer_poll.go +++ b/app/internal/handlers/volunteer_poll.go @@ -93,10 +93,11 @@ func PollHandler(w http.ResponseWriter, r *http.Request) { // Parse boolean values var question1VotedBefore *bool if val := r.FormValue("question1_voted_before"); val != "" { - if val == "true" { + switch val { + case "true": b := true question1VotedBefore = &b - } else if val == "false" { + case "false": b := false question1VotedBefore = &b } @@ -104,10 +105,11 @@ func PollHandler(w http.ResponseWriter, r *http.Request) { var question2VoteAgain *bool if val := r.FormValue("question2_vote_again"); val != "" { - if val == "true" { + switch val { + case "true": b := true question2VoteAgain = &b - } else if val == "false" { + case "false": b := false question2VoteAgain = &b } diff --git a/app/internal/templates/volunteer/poll_form.html b/app/internal/templates/volunteer/poll_form.html index 346418c..8047350 100644 --- a/app/internal/templates/volunteer/poll_form.html +++ b/app/internal/templates/volunteer/poll_form.html @@ -54,21 +54,23 @@