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

Backport 

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit 63e5db5d7a)
archive/2023-01-28/v1.18/crystal
John Olheiser 2 years ago committed by Loïc Dachary
parent 86857fdac3
commit 1b84e7a24d
No known key found for this signature in database
GPG Key ID: 992D23B392F9E4F2

@ -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