Esri / Esri/arcgis-python-api

Cloning item is not assigning the correct owner

Open
#2,500 0 comments 0 reactions 1 assignee Claimed by @nparavicini7 View on GitHub
bug
Dominant language
Python
Stars
2.2k
Forks
1.2k
Avg merge
2h 40m
Merged PRs (30d)
2

Description

**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)`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.