Fix 500 error viewing pull request when fork has pull requests disabled (#22512) (#22515)

Backport #22512

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
mj-v1.18.3
John Olheiser 1 year ago committed by GitHub
parent e6e2c2f4a4
commit 63e5db5d7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -109,6 +109,9 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
if pr.ProtectedBranch == nil {
prUnit, err := pr.BaseRepo.GetUnit(unit.TypePullRequests)
if err != nil {
if repo_model.IsErrUnitTypeNotExist(err) {
return false, false, nil
}
log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err)
return false, false, err
}

Loading…
Cancel
Save