summaryrefslogtreecommitdiffstats
path: root/models/issue_label.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-02-11 20:56:57 +0800
committerGitHub <noreply@github.com>2017-02-11 20:56:57 +0800
commit8a0be5e9f01caaf3667c420f08541ac7c26127b8 (patch)
treea1f2cfc2e7fd4932cd350121746266c03506e86a /models/issue_label.go
parent442145dbd348a18915de80faea68f30a9d9309b3 (diff)
downloadgitea-8a0be5e9f01caaf3667c420f08541ac7c26127b8.tar.gz
gitea-8a0be5e9f01caaf3667c420f08541ac7c26127b8.zip
Bug fixed for deleted label in issue comment (#904)
* bug fixed for deleted label in issue comment * fix indent
Diffstat (limited to 'models/issue_label.go')
-rw-r--r--models/issue_label.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/issue_label.go b/models/issue_label.go
index 970b3fcc4c..015e7f128d 100644
--- a/models/issue_label.go
+++ b/models/issue_label.go
@@ -249,6 +249,11 @@ func DeleteLabel(repoID, labelID int64) error {
return err
}
+ // Clear label id in comment table
+ if _, err = sess.Where("label_id = ?", labelID).Cols("label_id").Update(&Comment{}); err != nil {
+ return err
+ }
+
return sess.Commit()
}