mirror of
https://github.com/go-gitea/gitea.git
synced 2025-01-06 17:17:44 +03:00
Ignore view_as param when the profiles not both exist
This commit is contained in:
parent
86e698dc16
commit
e95d7166ed
@ -124,6 +124,7 @@ func home(ctx *context.Context, viewRepositories bool) {
|
|||||||
ctx.ServerError("RenderOrgHeader", err)
|
ctx.ServerError("RenderOrgHeader", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
isBothProfilesExist := ctx.Data["HasPublicProfileReadme"] == true && ctx.Data["HasPrivateProfileReadme"] == true
|
||||||
|
|
||||||
isViewerMember := ctx.FormString("view_as")
|
isViewerMember := ctx.FormString("view_as")
|
||||||
ctx.Data["IsViewerMember"] = isViewerMember == "member"
|
ctx.Data["IsViewerMember"] = isViewerMember == "member"
|
||||||
@ -133,7 +134,7 @@ func home(ctx *context.Context, viewRepositories bool) {
|
|||||||
profileType = "Private"
|
profileType = "Private"
|
||||||
}
|
}
|
||||||
|
|
||||||
if isViewerMember == "" {
|
if !isBothProfilesExist {
|
||||||
if !prepareOrgProfileReadme(ctx, viewRepositories, "Public") {
|
if !prepareOrgProfileReadme(ctx, viewRepositories, "Public") {
|
||||||
if !prepareOrgProfileReadme(ctx, viewRepositories, "Private") {
|
if !prepareOrgProfileReadme(ctx, viewRepositories, "Private") {
|
||||||
ctx.Data["PageIsViewRepositories"] = true
|
ctx.Data["PageIsViewRepositories"] = true
|
||||||
|
Loading…
Reference in New Issue
Block a user