Disable add key button if SSH is disabled (#2873)

This commit is contained in:
Michael Kuhn authored and Lunny Xiao committed 2017-11-21 11:49:33 +08:00
1 parent 1f7aab6e19
commit 420fc8efc2
8 files changed
+39 -8

No files matched your search

+1 -1
View File
@@ -260,7 +260,7 @@ func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
// It returns the actual public key line on success.
func CheckPublicKeyString(content string) (_ string, err error) {
if setting.SSH.Disabled {
return "", errors.New("SSH is disabled")
return "", ErrSSHDisabled{}
}
content, err = parseKeyString(content)