Skip to content

Commit 4347353

Browse files
committed
Ignore view_as param when the profiles not both exist
1 parent 55af509 commit 4347353

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

routers/web/org/home.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func home(ctx *context.Context, viewRepositories bool) {
124124
ctx.ServerError("RenderOrgHeader", err)
125125
return
126126
}
127+
isBothProfilesExist := ctx.Data["HasPublicProfileReadme"] == true && ctx.Data["HasPrivateProfileReadme"] == true
127128

128129
isViewerMember := ctx.FormString("view_as")
129130
ctx.Data["IsViewerMember"] = isViewerMember == "member"
@@ -133,7 +134,7 @@ func home(ctx *context.Context, viewRepositories bool) {
133134
profileType = "Private"
134135
}
135136

136-
if isViewerMember == "" {
137+
if !isBothProfilesExist {
137138
if !prepareOrgProfileReadme(ctx, viewRepositories, "Public") {
138139
if !prepareOrgProfileReadme(ctx, viewRepositories, "Private") {
139140
ctx.Data["PageIsViewRepositories"] = true

0 commit comments

Comments
 (0)