diff options
author | Unknwon <u@gogs.io> | 2015-02-28 22:24:53 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-02-28 22:24:53 -0500 |
commit | d446be9f5f1e4584c329dc418a9699960cb431e1 (patch) | |
tree | 02f7976cdbfe2848b0e1eed5cfd1580cf32ca202 /models | |
parent | 8d17ff8ce7a563be7abd54573cb91894a2bfdab6 (diff) | |
download | gitea-d446be9f5f1e4584c329dc418a9699960cb431e1.tar.gz gitea-d446be9f5f1e4584c329dc418a9699960cb431e1.zip |
models: mirror fix on #964
Diffstat (limited to 'models')
-rw-r--r-- | models/publickey.go | 1 | ||||
-rw-r--r-- | models/user.go | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/models/publickey.go b/models/publickey.go index 383b85b634..6bec1139b8 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -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) diff --git a/models/user.go b/models/user.go index f5bec2e83a..ea5041bdff 100644 --- a/models/user.go +++ b/models/user.go @@ -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 } |