summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/gpg_key.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-21 12:45:50 +0200
committerGitHub <noreply@github.com>2020-08-21 12:45:50 +0200
commit7c2cf236f8a54038e1688e6256e6c32b8b4e6913 (patch)
tree2b91975d306c3de933a2ca949507d5b2f87ce3eb /routers/api/v1/user/gpg_key.go
parent[skip ci] Updated translations via Crowdin (diff)
downloadforgejo-7c2cf236f8a54038e1688e6256e6c32b8b4e6913.tar.xz
forgejo-7c2cf236f8a54038e1688e6256e6c32b8b4e6913.zip
Allow addition of gpg keyring with multiple keys (#12487)
Related #6778 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers/api/v1/user/gpg_key.go')
-rw-r--r--routers/api/v1/user/gpg_key.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/user/gpg_key.go b/routers/api/v1/user/gpg_key.go
index 9fbe351c27..7290ef485a 100644
--- a/routers/api/v1/user/gpg_key.go
+++ b/routers/api/v1/user/gpg_key.go
@@ -118,12 +118,12 @@ func GetGPGKey(ctx *context.APIContext) {
// CreateUserGPGKey creates new GPG key to given user by ID.
func CreateUserGPGKey(ctx *context.APIContext, form api.CreateGPGKeyOption, uid int64) {
- key, err := models.AddGPGKey(uid, form.ArmoredKey)
+ keys, err := models.AddGPGKey(uid, form.ArmoredKey)
if err != nil {
HandleAddGPGKeyError(ctx, err)
return
}
- ctx.JSON(http.StatusCreated, convert.ToGPGKey(key))
+ ctx.JSON(http.StatusCreated, convert.ToGPGKey(keys[0]))
}
// swagger:parameters userCurrentPostGPGKey