Do requested changes

This commit is contained in:
JakobDev 2024-05-17 23:05:52 +02:00
parent ca322654c1
commit a1b1e6c279
No known key found for this signature in database
GPG Key ID: 39DEF62C3ED6DC4C
2 changed files with 7 additions and 1 deletions

View File

@ -175,7 +175,7 @@ func DeleteStarListByID(ctx context.Context, id int64) error {
}
// LoadRepositoryCount loads just the RepositoryCount.
// The count checks if how many repos in the list the actor is able to see.
// The count checks how many repos in the list the actor is able to see.
func (starList *StarList) LoadRepositoryCount(ctx context.Context, actor *user_model.User) error {
count, err := CountRepository(ctx, &SearchRepoOptions{Actor: actor, StarListID: starList.ID})
if err != nil {

View File

@ -8,6 +8,7 @@ import (
"net/http"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/web"
@ -26,6 +27,11 @@ func ShowStarList(ctx *context.Context) {
return
}
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
return
}
shared_user.PrepareContextForProfileBigAvatar(ctx)
err := shared_user.LoadHeaderCount(ctx)