skip penalties check when already solved
This commit is contained in:
2
klice.go
2
klice.go
@@ -231,6 +231,7 @@ func qrHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get penalties for this task and team
|
// get penalties for this task and team
|
||||||
|
if help != 0 {
|
||||||
err = db.QueryRow("SELECT minutes FROM penalties WHERE team_id = ? AND task_id = ?", teamID, taskID).Scan(&penalty)
|
err = db.QueryRow("SELECT minutes FROM penalties WHERE team_id = ? AND task_id = ?", teamID, taskID).Scan(&penalty)
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
penalty = 0
|
penalty = 0
|
||||||
@@ -244,6 +245,7 @@ func qrHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
} else if penalty > smallHelpPenalty {
|
} else if penalty > smallHelpPenalty {
|
||||||
help = 2
|
help = 2
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// handle answer and help form submission
|
// handle answer and help form submission
|
||||||
if r.Method == http.MethodPost {
|
if r.Method == http.MethodPost {
|
||||||
|
|||||||
Reference in New Issue
Block a user