forked from kevadesu/forgejo
make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945)
This commit is contained in:
parent
f6eb669b51
commit
acb6f8a518
2 changed files with 2 additions and 2 deletions
|
@ -586,7 +586,7 @@ func DeployKeysPost(ctx *context.Context, form auth.AddKeyForm) {
|
|||
if err != nil {
|
||||
ctx.Data["HasError"] = true
|
||||
switch {
|
||||
case models.IsErrKeyAlreadyExist(err):
|
||||
case models.IsErrDeployKeyAlreadyExist(err):
|
||||
ctx.Data["Err_Content"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.settings.key_been_used"), tplDeployKeys, &form)
|
||||
case models.IsErrKeyNameAlreadyUsed(err):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue