diff options
Diffstat (limited to 'routers/web/repo/view.go')
-rw-r--r-- | routers/web/repo/view.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 1293882cc5..33420aab3b 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -22,6 +22,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" unit_model "code.gitea.io/gitea/models/unit" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/cache" "code.gitea.io/gitea/modules/charset" @@ -449,7 +450,12 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st return } if lfsLock != nil { - ctx.Data["LFSLockOwner"] = lfsLock.Owner.DisplayName() + u, err := user_model.GetUserByID(lfsLock.OwnerID) + if err != nil { + ctx.ServerError("GetTreePathLock", err) + return + } + ctx.Data["LFSLockOwner"] = u.DisplayName() ctx.Data["LFSLockHint"] = ctx.Tr("repo.editor.this_file_locked") } @@ -777,7 +783,7 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri return nil } ctx.Data["LatestCommitVerification"] = verification - ctx.Data["LatestCommitUser"] = models.ValidateCommitWithEmail(latestCommit) + ctx.Data["LatestCommitUser"] = user_model.ValidateCommitWithEmail(latestCommit) } statuses, err := models.GetLatestCommitStatus(ctx.Repo.Repository.ID, ctx.Repo.Commit.ID.String(), db.ListOptions{}) @@ -893,7 +899,7 @@ func renderCode(ctx *context.Context) { } // RenderUserCards render a page show users according the input template -func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOptions) ([]*models.User, error), tpl base.TplName) { +func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOptions) ([]*user_model.User, error), tpl base.TplName) { page := ctx.FormInt("page") if page <= 0 { page = 1 @@ -928,7 +934,7 @@ func Stars(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.stargazers") ctx.Data["CardsTitle"] = ctx.Tr("repo.stargazers") ctx.Data["PageIsStargazers"] = true - RenderUserCards(ctx, ctx.Repo.Repository.NumStars, func(opts db.ListOptions) ([]*models.User, error) { + RenderUserCards(ctx, ctx.Repo.Repository.NumStars, func(opts db.ListOptions) ([]*user_model.User, error) { return models.GetStargazers(ctx.Repo.Repository, opts) }, tplWatchers) } |