aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeripath2022-06-17 22:42:51 +0100
committerGitHub2022-06-17 22:42:51 +0100
commit5d80feb5a6afebd313ed3c17d45920adfadb6af4 (patch)
tree3205eeac1561dc319f1510c34a2af9032098102f
parent1e9ad8eb2112a6354cf1fc75f5d8034062cbe89f (diff)
Fix CountOrphanedLabels in orphan check (#20009)
gitea doctor --run check-db-consistency is currently broken due to an incorrect and old use of Count() with a string. Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--models/issues/label.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/issues/label.go b/models/issues/label.go
index 98e2e4396..9ad488252 100644
--- a/models/issues/label.go
+++ b/models/issues/label.go
@@ -733,7 +733,7 @@ func DeleteLabelsByRepoID(ctx context.Context, repoID int64) error {
// CountOrphanedLabels return count of labels witch are broken and not accessible via ui anymore
func CountOrphanedLabels() (int64, error) {
- noref, err := db.GetEngine(db.DefaultContext).Table("label").Where("repo_id=? AND org_id=?", 0, 0).Count("label.id")
+ noref, err := db.GetEngine(db.DefaultContext).Table("label").Where("repo_id=? AND org_id=?", 0, 0).Count()
if err != nil {
return 0, err
}