aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/user/home.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/user/home.go')
-rw-r--r--routers/web/user/home.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index d3883571ed..bad621f91f 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -15,6 +15,7 @@ import (
"strings"
"code.gitea.io/gitea/models"
+ asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unit"
@@ -827,7 +828,7 @@ func repoIDMap(ctxUser *user_model.User, issueCountByRepo map[int64]int64, unitT
// ShowSSHKeys output all the ssh keys of user by uid
func ShowSSHKeys(ctx *context.Context, uid int64) {
- keys, err := models.ListPublicKeys(uid, db.ListOptions{})
+ keys, err := asymkey_model.ListPublicKeys(uid, db.ListOptions{})
if err != nil {
ctx.ServerError("ListPublicKeys", err)
return
@@ -843,7 +844,7 @@ func ShowSSHKeys(ctx *context.Context, uid int64) {
// ShowGPGKeys output all the public GPG keys of user by uid
func ShowGPGKeys(ctx *context.Context, uid int64) {
- keys, err := models.ListGPGKeys(uid, db.ListOptions{})
+ keys, err := asymkey_model.ListGPGKeys(db.DefaultContext, uid, db.ListOptions{})
if err != nil {
ctx.ServerError("ListGPGKeys", err)
return
@@ -851,9 +852,9 @@ func ShowGPGKeys(ctx *context.Context, uid int64) {
entities := make([]*openpgp.Entity, 0)
failedEntitiesID := make([]string, 0)
for _, k := range keys {
- e, err := models.GPGKeyToEntity(k)
+ e, err := asymkey_model.GPGKeyToEntity(k)
if err != nil {
- if models.IsErrGPGKeyImportNotExist(err) {
+ if asymkey_model.IsErrGPGKeyImportNotExist(err) {
failedEntitiesID = append(failedEntitiesID, k.KeyID)
continue //Skip previous import without backup of imported armored key
}