Skip to content

Commit 5c9363e

Browse files
zeripathSysoev, Vladimir
authored and
Sysoev, Vladimir
committed
Fix CountOrphanedLabels in orphan check (go-gitea#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 <[email protected]>
1 parent cfca797 commit 5c9363e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/issues/label.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ func DeleteLabelsByRepoID(ctx context.Context, repoID int64) error {
733733

734734
// CountOrphanedLabels return count of labels witch are broken and not accessible via ui anymore
735735
func CountOrphanedLabels() (int64, error) {
736-
noref, err := db.GetEngine(db.DefaultContext).Table("label").Where("repo_id=? AND org_id=?", 0, 0).Count("label.id")
736+
noref, err := db.GetEngine(db.DefaultContext).Table("label").Where("repo_id=? AND org_id=?", 0, 0).Count()
737737
if err != nil {
738738
return 0, err
739739
}

0 commit comments

Comments
 (0)