Commit f2fb574d authored by Phil Hughes's avatar Phil Hughes

Updated erorr message when project limit is zero

When the project limit is zero & the user tries to create a project, the error displayed is now 'Personal project creation is not allowed. Please contact your administrator with questions'

Closes #17691
parent baa9c660
...@@ -431,7 +431,13 @@ class Project < ActiveRecord::Base ...@@ -431,7 +431,13 @@ class Project < ActiveRecord::Base
def check_limit def check_limit
unless creator.can_create_project? or namespace.kind == 'group' unless creator.can_create_project? or namespace.kind == 'group'
self.errors.add(:limit_reached, "Your project limit is #{creator.projects_limit} projects! Please contact your administrator to increase it") projects_limit = creator.projects_limit
if projects_limit == 0
self.errors.add(:base, "Personal project creation is not allowed. Please contact your administrator with questions")
else
self.errors.add(:base, "Your project limit is #{projects_limit} projects! Please contact your administrator to increase it")
end
end end
rescue rescue
self.errors.add(:base, "Can't check your ability to create project") self.errors.add(:base, "Can't check your ability to create project")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment