From de10d9be08034ff285480c14b86be0c1824df16b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 16 Aug 2018 20:17:19 +0800 Subject: models: fix delete undesired release attachments when delete a comment (#4627) Apparently, AfterDelete has ID=0 --- models/attachment.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'models/attachment.go') diff --git a/models/attachment.go b/models/attachment.go index 31ca7f3e..e053ebff 100644 --- a/models/attachment.go +++ b/models/attachment.go @@ -165,7 +165,6 @@ func DeleteAttachments(attachments []*Attachment, remove bool) (int, error) { // DeleteAttachmentsByIssue deletes all attachments associated with the given issue. func DeleteAttachmentsByIssue(issueId int64, remove bool) (int, error) { attachments, err := GetAttachmentsByIssueID(issueId) - if err != nil { return 0, err } @@ -176,7 +175,6 @@ func DeleteAttachmentsByIssue(issueId int64, remove bool) (int, error) { // DeleteAttachmentsByComment deletes all attachments associated with the given comment. func DeleteAttachmentsByComment(commentId int64, remove bool) (int, error) { attachments, err := GetAttachmentsByCommentID(commentId) - if err != nil { return 0, err } -- cgit v1.2.3