Accidentally got false and true mixed up in checkUsernameTaken

This commit is contained in:
Tracker-Friendly 2024-06-25 00:34:32 +01:00
parent 5f8bf52194
commit 7dfa018fe6
1 changed files with 2 additions and 2 deletions

View File

@ -148,13 +148,13 @@ func checkUsernameTaken(username string) (int, bool, error) {
err := conn.QueryRow("SELECT id FROM users WHERE lower(username) = ? LIMIT 1", username).Scan(&id)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return 0, true, nil
return 0, false, nil
} else {
return 0, true, err
}
}
return id, false, nil
return id, true, nil
}
func init_db() {