Commit 7e45ba70 authored by Sebastian Ziebell's avatar Sebastian Ziebell

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.
parent 1a01fc0c
......@@ -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!
......
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