API: fixes return code when creating last project before reaching limit

When creating the last project via API when reaching the project limit a status code
of 404 (Not found) is returned instead of 201 (Created). The fix checks now correctly if
the project could be saved.
This commit is contained in:
Sebastian Ziebell 2013-02-14 11:14:52 +01:00
parent 1a01fc0c96
commit 7e45ba7004

View file

@ -44,7 +44,7 @@ module Gitlab
:merge_requests_enabled,
:wiki_enabled]
@project = ::Projects::CreateContext.new(current_user, attrs).execute
if @project.saved?
if @project.persisted?
present @project, with: Entities::Project
else
not_found!