forked from forgejo/forgejo
Less naked returns (#25713)
just a step towards #25655 and some related refactoring
This commit is contained in:
parent
b1eb1676aa
commit
8995046110
32 changed files with 254 additions and 239 deletions
|
@ -1922,9 +1922,12 @@ func ViewIssue(ctx *context.Context) {
|
|||
ctx.HTML(http.StatusOK, tplIssueView)
|
||||
}
|
||||
|
||||
// checkBlockedByIssues return canRead and notPermitted
|
||||
func checkBlockedByIssues(ctx *context.Context, blockers []*issues_model.DependencyInfo) (canRead, notPermitted []*issues_model.DependencyInfo) {
|
||||
var lastRepoID int64
|
||||
var lastPerm access_model.Permission
|
||||
var (
|
||||
lastRepoID int64
|
||||
lastPerm access_model.Permission
|
||||
)
|
||||
for i, blocker := range blockers {
|
||||
// Get the permissions for this repository
|
||||
perm := lastPerm
|
||||
|
@ -1936,7 +1939,7 @@ func checkBlockedByIssues(ctx *context.Context, blockers []*issues_model.Depende
|
|||
perm, err = access_model.GetUserRepoPermission(ctx, &blocker.Repository, ctx.Doer)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetUserRepoPermission", err)
|
||||
return
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
lastRepoID = blocker.Repository.ID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue