mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-31 15:21:00 +08:00
rsponse 404 when delete not exist email (#15383)
fix #15357 Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
@ -6,7 +6,6 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/mail"
|
||||
"strings"
|
||||
@ -18,9 +17,6 @@ import (
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
// ErrEmailAddressNotExist email address not exist
|
||||
var ErrEmailAddressNotExist = errors.New("Email address does not exist")
|
||||
|
||||
// EmailAddress is the list of all email addresses of a user. Can contain the
|
||||
// primary email address, but is not obligatory.
|
||||
type EmailAddress struct {
|
||||
@ -243,7 +239,7 @@ func DeleteEmailAddress(email *EmailAddress) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
} else if deleted != 1 {
|
||||
return ErrEmailAddressNotExist
|
||||
return ErrEmailAddressNotExist{Email: email.Email}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user