mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-22 12:54:53 -05:00
Hide the "Details" link of commit status when the user cannot access actions (followup)
commit.Status may be nil
This commit is contained in:
parent
c8e5e39865
commit
170c1c5152
2 changed files with 6 additions and 0 deletions
|
@ -463,6 +463,9 @@ func processGitCommits(ctx *context.Context, gitCommits []*git.Commit) []*git_mo
|
||||||
commits := git_model.ConvertFromGitCommit(ctx, gitCommits, ctx.Repo.Repository)
|
commits := git_model.ConvertFromGitCommit(ctx, gitCommits, ctx.Repo.Repository)
|
||||||
if !ctx.Repo.CanRead(unit_model.TypeActions) {
|
if !ctx.Repo.CanRead(unit_model.TypeActions) {
|
||||||
for _, commit := range commits {
|
for _, commit := range commits {
|
||||||
|
if commit.Status == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
commit.Status.HideActionsURL(ctx)
|
commit.Status.HideActionsURL(ctx)
|
||||||
git_model.CommitStatusesHideActionsURL(ctx, commit.Statuses)
|
git_model.CommitStatusesHideActionsURL(ctx, commit.Statuses)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1784,6 +1784,9 @@ func ViewIssue(ctx *context.Context) {
|
||||||
}
|
}
|
||||||
if !ctx.Repo.CanRead(unit.TypeActions) {
|
if !ctx.Repo.CanRead(unit.TypeActions) {
|
||||||
for _, commit := range comment.Commits {
|
for _, commit := range comment.Commits {
|
||||||
|
if commit.Status == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
commit.Status.HideActionsURL(ctx)
|
commit.Status.HideActionsURL(ctx)
|
||||||
git_model.CommitStatusesHideActionsURL(ctx, commit.Statuses)
|
git_model.CommitStatusesHideActionsURL(ctx, commit.Statuses)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue