Skip to content

Commit 6a7a5ea

Browse files
npease18lunnyGiteaBot
authored
Do not show Profile README when repository is private (#26295)
As mentioned in the original thread (#23260) and in the enhancements PR #24753, this PR ensures the .profile repository is public before the README file is shown. Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent 30eae5a commit 6a7a5ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/shared/user/header.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
8585

8686
func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) {
8787
profileDbRepo, err := repo_model.GetRepositoryByName(ctx.ContextUser.ID, ".profile")
88-
if err == nil && !profileDbRepo.IsEmpty {
88+
if err == nil && !profileDbRepo.IsEmpty && !profileDbRepo.IsPrivate {
8989
if profileGitRepo, err = git.OpenRepository(ctx, profileDbRepo.RepoPath()); err != nil {
9090
log.Error("FindUserProfileReadme failed to OpenRepository: %v", err)
9191
} else {

0 commit comments

Comments
 (0)