From 3025824415184c16f86bb67276474113de48d813 Mon Sep 17 00:00:00 2001 From: Sebastian Ziebell Date: Thu, 14 Feb 2013 12:58:33 +0100 Subject: 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. --- lib/api/projects.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/projects.rb') diff --git a/lib/api/projects.rb b/lib/api/projects.rb index e0c1e338290..d416121a78a 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -44,7 +44,7 @@ module Gitlab :merge_requests_enabled, :wiki_enabled] @project = ::Projects::CreateContext.new(current_user, attrs).execute - if @project.persisted? + if @project.saved? present @project, with: Entities::Project else not_found! -- cgit v1.2.1