From 5d80feb5a6afebd313ed3c17d45920adfadb6af4 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 17 Jun 2022 22:42:51 +0100 Subject: [PATCH] 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 --- models/issues/label.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/issues/label.go b/models/issues/label.go index 98e2e43961..9ad488252a 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 }