Draft: Fix warning when user is unable to create project
What does this MR do and why?
A vague warning, Namespace is not valid, was shown if a user tries to
create a project when his maximum number of projects has been reached.
After this change, a more specific warning, You've already reached the maximum number of projects you can create in your namespace. Delete unused projects or contact your GitLab administrator., is shown.
This change assumes that current_user.can?(:create_projects, parent_namespace) only check for the condition projects_limit_left > 0. See
https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/user.rb#L1184.
If additional checks are performed on top of this one, I would suggest
to drop this MR and perform a more specific check.
Screenshots or screen recordings
Before
After
How to set up and validate locally
- As an admin, go to the users table, select user X, click on the
Editand set theProjects limitto zero. - As user X, try to create a project
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.

