Fix preview for cells creating [SCI-10849]

This commit is contained in:
Anton 2024-07-10 15:08:46 +02:00
parent fbc7b5456c
commit ea8ae04791

View file

@ -241,12 +241,15 @@ module RepositoryImportParser
repository_cell repository_cell
else else
# Create new cell # Create new cell
cell_value.repository_cell.value = cell_value
repository_row.repository_cells << cell_value.repository_cell
if @preview if @preview
cell_value.validate repository_cell = repository_row.repository_cells.build(value: cell_value, repository_column: cell_value.repository_cell.repository_column)
cell_value.repository_cell.id = SecureRandom.uuid.gsub(/[a-zA-Z-]/, '') unless cell_value.repository_cell.id.present? # ID required for preview with serializer repository_cell.validate
repository_cell.id = SecureRandom.uuid.gsub(/[a-zA-Z-]/, '') unless cell_value.repository_cell.id.present? # ID required for preview with serializer
return repository_cell
else else
cell_value.repository_cell.value = cell_value
repository_row.repository_cells << cell_value.repository_cell
cell_value.save! cell_value.save!
end end
@updated ||= true @updated ||= true