backend: Don't fail if an hint is already opened

This commit is contained in:
nemunaire 2022-07-12 18:39:23 +02:00
parent 9bc9851b12
commit 41fb5a1cd0
2 changed files with 9 additions and 2 deletions

View file

@ -42,7 +42,7 @@ func treatOpeningHint(pathname string, team *fic.Team) {
log.Printf("%s [!!!] The team asks to open an hint whereas it doesn't have access to the exercice\n", id)
} else if !team.CanSeeHint(hint) {
log.Printf("%s [!!!] The team asks to open an hint whereas it doesn't have access to it due to hint dependencies\n", id)
} else if err = team.OpenHint(hint); err != nil {
} else if err = team.OpenHint(hint); err != nil && !fic.DBIsDuplicateKeyError(err) { // Skip DUPLICATE KEY errors
log.Printf("%s [ERR] Unable to open hint: %s\n", id, err)
} else {
// Write event