mirror of https://github.com/gogs/gogs.git
Fix showing total number of PRs when user does not have any repositories (#4007)
parent
5e01ecbc05
commit
7b3b46c675
2
gogs.go
2
gogs.go
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.124.0128"
|
const APP_VER = "0.9.125.0128"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
|
|
@ -1169,13 +1169,13 @@ func GetIssueStats(opts *IssueStatsOptions) *IssueStats {
|
||||||
// GetUserIssueStats returns issue statistic information for dashboard by given conditions.
|
// GetUserIssueStats returns issue statistic information for dashboard by given conditions.
|
||||||
func GetUserIssueStats(repoID, userID int64, repoIDs []int64, filterMode FilterMode, isPull bool) *IssueStats {
|
func GetUserIssueStats(repoID, userID int64, repoIDs []int64, filterMode FilterMode, isPull bool) *IssueStats {
|
||||||
stats := &IssueStats{}
|
stats := &IssueStats{}
|
||||||
hasAnyRepo := repoID > 0 || repoIDs != nil
|
hasAnyRepo := repoID > 0 || len(repoIDs) > 0
|
||||||
countSession := func(isClosed, isPull bool, repoID int64, repoIDs []int64) *xorm.Session {
|
countSession := func(isClosed, isPull bool, repoID int64, repoIDs []int64) *xorm.Session {
|
||||||
sess := x.Where("issue.is_closed = ?", isClosed).And("issue.is_pull = ?", isPull)
|
sess := x.Where("issue.is_closed = ?", isClosed).And("issue.is_pull = ?", isPull)
|
||||||
|
|
||||||
if repoID > 0 {
|
if repoID > 0 {
|
||||||
sess.And("repo_id = ?", repoID)
|
sess.And("repo_id = ?", repoID)
|
||||||
} else if repoIDs != nil {
|
} else if len(repoIDs) > 0 {
|
||||||
sess.In("repo_id", repoIDs)
|
sess.In("repo_id", repoIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.9.124.0128
|
0.9.125.0128
|
Loading…
Reference in New Issue