Commit 472f2d56 authored by Douwe Maan's avatar Douwe Maan

Merge branch '47765-group-visibility-error-due-to-string-conversion' into 'master'

Changes update_column to update_attributes in ProjectTreeRestorer#restore_project by using timeless to maintain the current timestamps

Closes #47765

See merge request gitlab-org/gitlab-ce!21242
parents 74c53ef6 6dfab422
---
title: Importing a project no longer fails when visibility level holds a string value
type
merge_request: 21242
author:
type: fixed
......@@ -94,7 +94,10 @@ module Gitlab
end
def restore_project
@project.update_columns(project_params)
Gitlab::Timeless.timeless(@project) do
@project.update(project_params)
end
@project
end
......
......@@ -63,6 +63,16 @@ describe Gitlab::ImportExport::Importer do
importer.execute
end
it 'sets the correct visibility_level when visibility level is a string' do
project.create_or_update_import_data(
data: { override_params: { visibility_level: Gitlab::VisibilityLevel::PRIVATE.to_s } }
)
importer.execute
expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
end
end
context 'when project successfully restored' do
......
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