Commit 3025824415184c16f86bb67276474113de48d813
1 parent
7e45ba70
Exists in
master
and in
4 other branches
API: refactored last fix, project limit in web client is fixed too
The previous call `saved?` is restored in the `POST /projects` method in the API. It is refactored to check if the record is persisted. This is useful to not validate the record again after saving. This fixes the returned status code in the web client too. If the last project is created via web client instead of error notification the project page is shown.
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/models/project.rb
lib/api/projects.rb
@@ -44,7 +44,7 @@ module Gitlab | @@ -44,7 +44,7 @@ module Gitlab | ||
44 | :merge_requests_enabled, | 44 | :merge_requests_enabled, |
45 | :wiki_enabled] | 45 | :wiki_enabled] |
46 | @project = ::Projects::CreateContext.new(current_user, attrs).execute | 46 | @project = ::Projects::CreateContext.new(current_user, attrs).execute |
47 | - if @project.persisted? | 47 | + if @project.saved? |
48 | present @project, with: Entities::Project | 48 | present @project, with: Entities::Project |
49 | else | 49 | else |
50 | not_found! | 50 | not_found! |