1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-01-04 09:17:43 +03:00

Ignore view_as param when the profiles not both exist

This commit is contained in:
changchaishi 2024-12-23 09:35:34 +00:00 committed by iknowright
parent 86e698dc16
commit e95d7166ed

View File

@ -124,6 +124,7 @@ func home(ctx *context.Context, viewRepositories bool) {
ctx.ServerError("RenderOrgHeader", err)
return
}
isBothProfilesExist := ctx.Data["HasPublicProfileReadme"] == true && ctx.Data["HasPrivateProfileReadme"] == true
isViewerMember := ctx.FormString("view_as")
ctx.Data["IsViewerMember"] = isViewerMember == "member"
@ -133,7 +134,7 @@ func home(ctx *context.Context, viewRepositories bool) {
profileType = "Private"
}
if isViewerMember == "" {
if !isBothProfilesExist {
if !prepareOrgProfileReadme(ctx, viewRepositories, "Public") {
if !prepareOrgProfileReadme(ctx, viewRepositories, "Private") {
ctx.Data["PageIsViewRepositories"] = true