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
- Create a project
- Create a policy
- Verify that
project.security_policieslists the policy - Update it to status: disabled
- Verify that it's not included in the
project.security_policies - Update it back to status: enabled
- Verify that
project.security_policiesreturns the policy
Related to #515866 (closed)