summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-11-28 11:19:55 +0000
committerDouwe Maan <douwe@gitlab.com>2018-11-28 11:19:55 +0000
commit5e3076f2d7fdb8f077cf9d951e55ed9798bb197e (patch)
treeffe87433a86631da9eaea423f59d6dec535dc54f /lib/api
parent57d982733c41490214eb58e8fd639057daa7c2ba (diff)
parentbad26e2dab81239f3cb2e7e3ea76ba113415638c (diff)
downloadgitlab-ce-5e3076f2d7fdb8f077cf9d951e55ed9798bb197e.tar.gz
Merge branch '50341-cleanup-useless-project-import-attributes' into 'master'
Removes all the irrelevant code and columns that were migrated from the Project… See merge request gitlab-org/gitlab-ce!21497
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index cff05643f3b..4788b0e16a1 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -145,7 +145,9 @@ module API
expose :import_status
# TODO: Use `expose_nil` once we upgrade the grape-entity gem
- expose :import_error, if: lambda { |status, _ops| status.import_error }
+ expose :import_error, if: lambda { |project, _ops| project.import_state&.last_error } do |project|
+ project.import_state.last_error
+ end
end
class BasicProjectDetails < ProjectIdentity
@@ -248,7 +250,10 @@ module API
expose :creator_id
expose :forked_from_project, using: Entities::BasicProjectDetails, if: lambda { |project, options| project.forked? }
expose :import_status
- expose :import_error, if: lambda { |_project, options| options[:user_can_admin_project] }
+
+ expose :import_error, if: lambda { |_project, options| options[:user_can_admin_project] } do |project|
+ project.import_state&.last_error
+ end
expose :open_issues_count, if: lambda { |project, options| project.feature_available?(:issues, options[:current_user]) }
expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] }