From 0b84b5ee4956e0da5a98d8a7707481a2832bb9fc Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jan 2019 02:10:46 +0800 Subject: fix public will not be reused as public key after deleting as deploy key (#5671) --- models/ssh_key.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'models') 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() -- cgit v1.2.3