diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-12 06:48:50 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-12 06:48:50 -0500 |
commit | 8c9338a5377c60c84cdee1f5781b3de5933bb3b0 (patch) | |
tree | 57de36743bf8b9c8eaa0ff51172180b834354c4d /models/publickey.go | |
parent | 21b9d5fa1f4014b30619d221f5d665509d373147 (diff) | |
download | gitea-8c9338a5377c60c84cdee1f5781b3de5933bb3b0.tar.gz gitea-8c9338a5377c60c84cdee1f5781b3de5933bb3b0.zip |
add personal access token panel #12
Diffstat (limited to 'models/publickey.go')
-rw-r--r-- | models/publickey.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/publickey.go b/models/publickey.go index 762d7333fa..f5e487fdbb 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -236,10 +236,10 @@ func GetPublicKeyById(keyId int64) (*PublicKey, error) { return key, nil } -// ListPublicKey returns a list of all public keys that user has. -func ListPublicKey(uid int64) ([]*PublicKey, error) { +// ListPublicKeys returns a list of public keys belongs to given user. +func ListPublicKeys(uid int64) ([]*PublicKey, error) { keys := make([]*PublicKey, 0, 5) - err := x.Find(&keys, &PublicKey{OwnerId: uid}) + err := x.Where("owner_id=?", uid).Find(&keys) if err != nil { return nil, err } |