Skip to content

Commit

Permalink
Ignore view_as param when the profiles not both exist
Browse files Browse the repository at this point in the history
  • Loading branch information
changchaishi committed Dec 23, 2024
1 parent 55af509 commit 4347353
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion routers/web/org/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 4347353

Please sign in to comment.