Remove removed from project user as approver

Summary

When users are removed from project (or group with this project), and even blocked, remove them from Approvers list.

Steps to reproduce

  • Create new project
  • Add a user UserA to the project
  • Add UserA as an approver and set required approvals to 1
  • Create a Merge Request
  • Notice that UserA is required to approve it
  • Remove UserA membership for the project
  • Notice that UserA's approval is still required for the MR before it can be merged

Example Project

What is the current bug behavior?

It's still default approver. And, if I'm right, approver of existing MRs.

What is the expected correct behavior?

Removed user should not be approver.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Results of GitLab application Check

Possible fixes

Edited by Mark Fletcher