mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
models: mirror fix on #964
This commit is contained in:
@@ -130,7 +130,6 @@ func extractTypeFromBase64Key(key string) (string, error) {
|
||||
|
||||
// Parse any key string in openssh or ssh2 format to clean openssh string (rfc4253)
|
||||
func ParseKeyString(content string) (string, error) {
|
||||
|
||||
// Transform all legal line endings to a single "\n"
|
||||
s := strings.Replace(strings.Replace(strings.TrimSpace(content), "\r\n", "\n", -1), "\r", "\n", -1)
|
||||
|
||||
|
@@ -40,7 +40,7 @@ var (
|
||||
ErrUserHasOrgs = errors.New("User still have membership of organization")
|
||||
ErrUserAlreadyExist = errors.New("User already exist")
|
||||
ErrUserNotExist = errors.New("User does not exist")
|
||||
ErrPublicKeyNotExist = errors.New("Public key does not exist")
|
||||
ErrUserNotKeyOwner = errors.New("User does not the owner of public key")
|
||||
ErrEmailAlreadyUsed = errors.New("E-mail already used")
|
||||
ErrEmailNotExist = errors.New("E-mail does not exist")
|
||||
ErrEmailNotActivated = errors.New("E-mail address has not been activated")
|
||||
@@ -518,7 +518,7 @@ func GetUserByKeyId(keyId int64) (*User, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrPublicKeyNotExist
|
||||
return nil, ErrUserNotKeyOwner
|
||||
}
|
||||
return user, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user