Fix linking of policy to the project

What does this MR do and why?

Fix linking of policy to the project.

When policy was disabled and re-enabled again, it wouldn't get linked to the project again. This MR fixes it.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Create a project
  2. Create a policy
  3. Verify that project.security_policies lists the policy
  4. Update it to status: disabled
  5. Verify that it's not included in the project.security_policies
  6. Update it back to status: enabled
  7. Verify that project.security_policies returns the policy

Related to #515866 (closed)

Merge request reports

Loading