fix delete comment bug

This commit is contained in:
Lunny Xiao 2018-06-11 08:51:03 +08:00
parent e3b77f92c1
commit 59841fe6c4
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -147,6 +147,10 @@ func (c *Comment) AfterLoad(session *xorm.Session) {
// AfterDelete is invoked from XORM after the object is deleted.
func (c *Comment) AfterDelete() {
if c.ID <= 0 {
return
}
_, err := DeleteAttachmentsByComment(c.ID, true)
if err != nil {