Fix for User Personal Projects if Instance AI Features are disabled
What does this MR do and why?
The purposes of this MR is to fix the bug reported in this Issue - where in a User's Personal Projects (example: user > personal_project) an error is thrown when an Instance has AI Settings banned.
Related Issues:
- #493718 (closed) - Error 500 when opening General settings of personal projects if Duo is disabled
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.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
For frontend changes:
- Go to Admin > Settings > GitLab Duo
- Select Never on and Click Save changes.
- Validate that Never on has been saved.
- Go to a User's personal Project. Ex: Go to Homepage by clicking the Tanuki Icon in the upper left hand corner. Click a personal project from the Personal projects tab and select a project.
- Go to the project's Settings, validate the page loads correctly.
- Go to Visibility, project features, permissions and validate that the GitLab Duo toggle is disabled with a cascading checkbox.
For backend changes:
- Run
bundle exec rspec spec/helpers/namespaces_helper_spec.rb

