|
|
|
@ -132,14 +132,6 @@ func (c *Comment) LoadAttributes() error {
|
|
|
|
|
return c.loadAttributes(x) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (c *Comment) AfterDelete() { |
|
|
|
|
_, err := DeleteAttachmentsByComment(c.ID, true) |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
log.Info("Could not delete files for comment %d on issue #%d: %s", c.ID, c.IssueID, err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (c *Comment) HTMLURL() string { |
|
|
|
|
return fmt.Sprintf("%s#issuecomment-%d", c.Issue.HTMLURL(), c.ID) |
|
|
|
|
} |
|
|
|
@ -519,7 +511,12 @@ func DeleteCommentByID(doer *User, id int64) error {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if err = sess.Commit(); err != nil { |
|
|
|
|
return fmt.Errorf("Commit: %v", err) |
|
|
|
|
return fmt.Errorf("commit: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_, err = DeleteAttachmentsByComment(comment.ID, true) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error(2, "Failed to delete attachments by comment[%d]: %v", comment.ID, err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if err = comment.Issue.LoadAttributes(); err != nil { |
|
|
|
|