mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix repo count in org action settings (#27245)
Only in org action settings, repo count is missing Before:    In other setting page:  After:   
This commit is contained in:
		@@ -14,6 +14,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/context"
 | 
						"code.gitea.io/gitea/modules/context"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
 | 
						actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
 | 
				
			||||||
 | 
						shared_user "code.gitea.io/gitea/routers/web/shared/user"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -53,6 +54,11 @@ func getRunnersCtx(ctx *context.Context) (*runnersCtx, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ctx.Data["PageIsOrgSettings"] == true {
 | 
						if ctx.Data["PageIsOrgSettings"] == true {
 | 
				
			||||||
 | 
							err := shared_user.LoadHeaderCount(ctx)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								ctx.ServerError("LoadHeaderCount", err)
 | 
				
			||||||
 | 
								return nil, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return &runnersCtx{
 | 
							return &runnersCtx{
 | 
				
			||||||
			RepoID:             0,
 | 
								RepoID:             0,
 | 
				
			||||||
			OwnerID:            ctx.Org.Organization.ID,
 | 
								OwnerID:            ctx.Org.Organization.ID,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/context"
 | 
						"code.gitea.io/gitea/modules/context"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	shared "code.gitea.io/gitea/routers/web/shared/secrets"
 | 
						shared "code.gitea.io/gitea/routers/web/shared/secrets"
 | 
				
			||||||
 | 
						shared_user "code.gitea.io/gitea/routers/web/shared/user"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -42,6 +43,11 @@ func getSecretsCtx(ctx *context.Context) (*secretsCtx, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ctx.Data["PageIsOrgSettings"] == true {
 | 
						if ctx.Data["PageIsOrgSettings"] == true {
 | 
				
			||||||
 | 
							err := shared_user.LoadHeaderCount(ctx)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								ctx.ServerError("LoadHeaderCount", err)
 | 
				
			||||||
 | 
								return nil, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return &secretsCtx{
 | 
							return &secretsCtx{
 | 
				
			||||||
			OwnerID:         ctx.ContextUser.ID,
 | 
								OwnerID:         ctx.ContextUser.ID,
 | 
				
			||||||
			RepoID:          0,
 | 
								RepoID:          0,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/context"
 | 
						"code.gitea.io/gitea/modules/context"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	shared "code.gitea.io/gitea/routers/web/shared/actions"
 | 
						shared "code.gitea.io/gitea/routers/web/shared/actions"
 | 
				
			||||||
 | 
						shared_user "code.gitea.io/gitea/routers/web/shared/user"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -40,6 +41,11 @@ func getVariablesCtx(ctx *context.Context) (*variablesCtx, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ctx.Data["PageIsOrgSettings"] == true {
 | 
						if ctx.Data["PageIsOrgSettings"] == true {
 | 
				
			||||||
 | 
							err := shared_user.LoadHeaderCount(ctx)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								ctx.ServerError("LoadHeaderCount", err)
 | 
				
			||||||
 | 
								return nil, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return &variablesCtx{
 | 
							return &variablesCtx{
 | 
				
			||||||
			OwnerID:           ctx.ContextUser.ID,
 | 
								OwnerID:           ctx.ContextUser.ID,
 | 
				
			||||||
			IsOrg:             true,
 | 
								IsOrg:             true,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user