mirror of
https://github.com/LAX18/gitea.git
synced 2026-06-03 14:07:55 -09:00
Do not show profile if repository is private
This commit is contained in:
@@ -85,7 +85,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
|
|||||||
|
|
||||||
func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) {
|
func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) {
|
||||||
profileDbRepo, err := repo_model.GetRepositoryByName(ctx.ContextUser.ID, ".profile")
|
profileDbRepo, err := repo_model.GetRepositoryByName(ctx.ContextUser.ID, ".profile")
|
||||||
if err == nil && !profileDbRepo.IsEmpty {
|
if err == nil && !profileDbRepo.IsEmpty && !profileDbRepo.IsPrivate {
|
||||||
if profileGitRepo, err = git.OpenRepository(ctx, profileDbRepo.RepoPath()); err != nil {
|
if profileGitRepo, err = git.OpenRepository(ctx, profileDbRepo.RepoPath()); err != nil {
|
||||||
log.Error("FindUserProfileReadme failed to OpenRepository: %v", err)
|
log.Error("FindUserProfileReadme failed to OpenRepository: %v", err)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user