Hello,
I seems find another two issue in Cell [22] in Clone Portal sample notebook. clone portal users groups and content | ArcGIS for Developers
Below is the screen shot of code that may have issue.
Issue 1: In this line,
target.content.create_folder(user, folder)
I checked API of create_folder() method, it writes
create_folder
(folder, owner=None), we have folder first, then the owner
But in the sample notebook code, the order is opposite.
Shouldn't we use, target.content.create_folder(folder, user) instead?
Issue 2:
I got another error when I access the folder title using folder.title. It returns following error message. For testing I create a test script.
The folder does have the key title, but for some reason we can't access it using folder.title in API. It causes problem in this sample notebook, since it uses folder.title to access the folder title.
Thanks
Solved! Go to Solution.
Hello,
I believe you've found more bugs in this sample.
1) It should be
target.content.create_folder(folder, user)
2) folder is a dict and not an object with a title property - so you'd need to replace folder.title with folder['title']
We'll be fixing these in the sample - thanks for reporting the issues.
Thanks,
Rohit
Hello,
I believe you've found more bugs in this sample.
1) It should be
target.content.create_folder(folder, user)
2) folder is a dict and not an object with a title property - so you'd need to replace folder.title with folder['title']
We'll be fixing these in the sample - thanks for reporting the issues.
Thanks,
Rohit
Thanks for clarification.
Hi Rohit,
I found one more issue in cell [22] in this sample notebook.
It is at #Copy the related items for this user (if specified)
For this line,
folderitems = usercontent[folder], I got error, because usercontent here is a list.
I think we should use folderitems = user.items(folder['title']) instead.
Looking forward to your comment on this.
Thanks.
Hi Xuehan,
Thanks for reporting this as well. Your fix is correct. We will be including this fix in the update to the sample within the next week, as part of the 1.0.1 update to the API.
Thanks,
Rohit