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.
This commit is contained in:
parent
6fc3263e15
commit
6df02adc7a
3 changed files with 17 additions and 1 deletions
|
@ -155,7 +155,7 @@ class Project < ActiveRecord::Base
|
|||
|
||||
def check_limit
|
||||
unless creator.can_create_project?
|
||||
errors[:base] << ("Your own projects limit is #{creator.projects_limit}! Please contact administrator to increase it")
|
||||
errors[:limit_reached] << ("Your own projects limit is #{creator.projects_limit}! Please contact administrator to increase it")
|
||||
end
|
||||
rescue
|
||||
errors[:base] << ("Can't check your ability to create project")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue