소스 검색

Fix delete SSH key in file

Unknown 11 년 전
부모
커밋
c83657307e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      models/publickey.go

+ 1 - 1
models/publickey.go

@@ -134,7 +134,7 @@ func DeletePublicKey(key *PublicKey) (err error) {
 		}
 
 		// Found the line and copy rest of file.
-		if strings.Contains(line, key.Content) {
+		if strings.Contains(line, fmt.Sprintf("key-%d", key.Id)) && strings.Contains(line, key.Content) {
 			continue
 		}
 		// Still finding the line, copy the line that currently read.