Commit 6dfab422 authored by Tiago Botelho's avatar Tiago Botelho

Changes update_column to update_attributes in...

Changes update_column to update_attributes in ProjectTreeRestorer#restore_project by using timeless to maintain the current timestamps
parent a0f23458
---
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 ...@@ -94,7 +94,10 @@ module Gitlab
end end
def restore_project def restore_project
@project.update_columns(project_params) Gitlab::Timeless.timeless(@project) do
@project.update(project_params)
end
@project @project
end end
......
...@@ -63,6 +63,16 @@ describe Gitlab::ImportExport::Importer do ...@@ -63,6 +63,16 @@ describe Gitlab::ImportExport::Importer do
importer.execute importer.execute
end 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 end
context 'when project successfully restored' do 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