Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-14 18:51:56 +0400
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-14 18:51:56 +0400
commit6df02adc7a5cb7badf748be783f9a552cf19aeee (patch)
tree67faa977dee10a764e95c2b0e82696ed804e7e7a /lib/api/projects.rb
parent6fc3263e15b71830e6f1b2a66891da5f4c055137 (diff)
API: status code 403 returned if new project would exceed limit
When the project limit is reached the user is not allowed to create new ones. Instead of error code 404 the status code 403 (Forbidden) is returned with error message via API.
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index ecd3401fd94..87653f04450 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -58,6 +58,9 @@ module Gitlab
if @project.saved?
present @project, with: Entities::Project
else
+ if @project.errors[:limit_reached].present?
+ error!(@project.errors[:limit_reached], 403)
+ end
not_found!
end
end