diff options
author | Phil Hughes <me@iamphill.com> | 2016-05-24 17:39:56 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-05-24 17:39:56 +0100 |
commit | f2fb574d0421eb3b24b640766fa2265fafe20130 (patch) | |
tree | dab761326f5b8bce3874b58a23fca46534155f73 | |
parent | baa9c66057fccefce05b9f01009942fb079fee22 (diff) | |
download | gitlab-ce-f2fb574d0421eb3b24b640766fa2265fafe20130.tar.gz |
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
-rw-r--r-- | app/models/project.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 37de1dfe4d5..2876150cd6e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -431,7 +431,13 @@ class Project < ActiveRecord::Base def check_limit 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 rescue self.errors.add(:base, "Can't check your ability to create project") |