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
This commit is contained in:
commit
472f2d5666
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue