@@ -120,9 +120,8 @@ func Home(ctx *context.Context) {
120
120
ctx .Data ["DisableNewPullMirrors" ] = setting .Mirror .DisableNewPull
121
121
ctx .Data ["ShowMemberAndTeamTab" ] = ctx .Org .IsMember || len (members ) > 0
122
122
123
- prepareOrgProfileReadme (ctx )
124
- if ctx .Written () {
125
- return
123
+ if ! prepareOrgProfileReadme (ctx ) {
124
+ ctx .Data ["PageIsViewRepositories" ] = true
126
125
}
127
126
128
127
var (
@@ -154,7 +153,6 @@ func Home(ctx *context.Context) {
154
153
155
154
ctx .Data ["Repos" ] = repos
156
155
ctx .Data ["Total" ] = count
157
- ctx .Data ["PageIsViewRepositories" ] = true
158
156
159
157
pager := context .NewPagination (int (count ), setting .UI .User .RepoPagingNum , page , 5 )
160
158
pager .SetDefaultParams (ctx )
@@ -164,18 +162,18 @@ func Home(ctx *context.Context) {
164
162
ctx .HTML (http .StatusOK , tplOrgHome )
165
163
}
166
164
167
- func prepareOrgProfileReadme (ctx * context.Context ) {
165
+ func prepareOrgProfileReadme (ctx * context.Context ) bool {
168
166
profileDbRepo , profileGitRepo , profileReadme , profileClose := shared_user .FindUserProfileReadme (ctx , ctx .Doer )
169
167
defer profileClose ()
170
168
ctx .Data ["HasProfileReadme" ] = profileReadme != nil
171
169
172
170
if profileGitRepo == nil || profileReadme == nil {
173
- return
171
+ return false
174
172
}
175
173
176
174
viewRepositorys := ctx .FormOptionalBool ("view_repositorys" )
177
175
if viewRepositorys .Value () {
178
- return
176
+ return false
179
177
}
180
178
181
179
if bytes , err := profileReadme .GetBlobContent (setting .UI .MaxDisplayFileSize ); err != nil {
@@ -199,5 +197,5 @@ func prepareOrgProfileReadme(ctx *context.Context) {
199
197
}
200
198
201
199
ctx .Data ["PageIsViewOverview" ] = true
202
- ctx . HTML ( http . StatusOK , tplOrgHome )
200
+ return true
203
201
}
0 commit comments