From 82f6f123cac81a2ba1d4971d33d3cdd1f843e61c Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Mon, 23 May 2022 09:18:47 +0800 Subject: [PATCH] fix-2054 --- models/org.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/org.go b/models/org.go index 2a6528023..c956f1f89 100755 --- a/models/org.go +++ b/models/org.go @@ -160,7 +160,11 @@ func UpdateOrgStatistics() { has, _ := x.Get(orgStat) orgStat.NumScore = numScore - if has { + + count, err := GetPublicRepositoryCount(&org) + if err != nil || count == 0 { + x.ID(orgStat.ID).Delete(new(OrgStatistic)) + } else if has { x.ID(orgStat.ID).Cols("num_score").Update(&orgStat) } else { x.Insert(orgStat)