mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 14:37:41 +02:00
Disable add key button if SSH is disabled (#2873)
This commit is contained in:
1 parent
1f7aab6e19
commit
420fc8efc2
8 files changed
+39
-8
No files matched your search
@@ -106,7 +106,9 @@ func GetDeployKey(ctx *context.APIContext) {
|
||||
|
||||
// HandleCheckKeyStringError handle check key error
|
||||
func HandleCheckKeyStringError(ctx *context.APIContext, err error) {
|
||||
if models.IsErrKeyUnableVerify(err) {
|
||||
if models.IsErrSSHDisabled(err) {
|
||||
ctx.Error(422, "", "SSH is disabled")
|
||||
} else if models.IsErrKeyUnableVerify(err) {
|
||||
ctx.Error(422, "", "Unable to verify key content")
|
||||
} else {
|
||||
ctx.Error(422, "", fmt.Errorf("Invalid key content: %v", err))
|
||||
|
||||
Reference in new issue
Block a user