summaryrefslogtreecommitdiffstats
path: root/models/ssh_key.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-01-10 02:10:46 +0800
committertechknowlogick <hello@techknowlogick.com>2019-01-09 13:10:46 -0500
commit0b84b5ee4956e0da5a98d8a7707481a2832bb9fc (patch)
tree4431bf3ac0efc3920ca884e110a14d35acab7923 /models/ssh_key.go
parent530c2b8ad8ad6f27ddfe96be409d18f94684c937 (diff)
downloadgitea-0b84b5ee4956e0da5a98d8a7707481a2832bb9fc.tar.gz
gitea-0b84b5ee4956e0da5a98d8a7707481a2832bb9fc.zip
fix public will not be reused as public key after deleting as deploy key (#5671)
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r--models/ssh_key.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go
index 27c5bf0808..90c0f04b78 100644
--- a/models/ssh_key.go
+++ b/models/ssh_key.go
@@ -844,6 +844,11 @@ func DeleteDeployKey(doer *User, id int64) error {
if err = deletePublicKeys(sess, key.KeyID); err != nil {
return err
}
+
+ // after deleted the public keys, should rewrite the public keys file
+ if err = rewriteAllPublicKeys(sess); err != nil {
+ return err
+ }
}
return sess.Commit()