requestRepo/newSecret: fix small bug

This commit is contained in:
Johannes 2022-09-24 14:17:36 +02:00
parent 961a10915b
commit 7a1448d6f9

View file

@ -118,7 +118,7 @@ func (r *RequestRepo) newSecret() (string, error) {
for !errors.Is(err, sql.ErrNoRows) {
secret = randomString(r.config.Request.SecretLength)
_, err = r.FindBySecret(secret)
if err != nil && errors.Is(err, sql.ErrNoRows) {
if err != nil && !errors.Is(err, sql.ErrNoRows) {
return "", err
}
}