fix: Ignore self review request notification

A notification would be trigger if a user request itself as review of a
PR.
This commit is contained in:
Gabriel A. Giovanini 2024-12-16 15:34:41 +01:00
parent 5b542d6c79
commit b698b256f1

View file

@ -72,7 +72,8 @@ func ReviewRequest(ctx context.Context, issue *issues_model.Issue, doer, reviewe
return nil, err return nil, err
} }
if comment != nil { // don't notify if the user is requesting itself as reviewer
if comment != nil && doer.ID != reviewer.ID {
notify_service.PullRequestReviewRequest(ctx, doer, issue, reviewer, isAdd, comment) notify_service.PullRequestReviewRequest(ctx, doer, issue, reviewer, isAdd, comment)
} }