Skip to content

Commit

Permalink
Fix CountOrphanedLabels in orphan check (go-gitea#20009)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zeripath authored and AbdulrhmnGhanem committed Aug 23, 2022
1 parent 92b6f19 commit 59c1583
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/issues/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 59c1583

Please sign in to comment.