Skip to content

Cloning item is not assigning the correct owner #2500

@MathieuLegault1

Description

@MathieuLegault1

Describe the bug
When cloning an item and setting a new owner, the owner will not be respected if that item does not have a folder.

To Reproduce
Clone an item without a folder and setting an owner

Platform (please complete the following information):

  • OS: Windows
  • Python API Version: 2.4.3

Additional context
The bug appears because when there is no folder the given owner is not respected.

if self.folder:
    folder = self.target.content.folders.get(
        folder=self.folder, owner=self.owner
    )
else:
    folder = self.target.content.folders.get()

The fix
folder = self.target.content.folders.get(owner=self.owner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions