Select to view content in your preferred language

Clone Portal Users Workflow regarding Remove existing users from target portal

804
1
Jump to solution
01-12-2017 09:45 AM
XuehanJing
Occasional Contributor

for In[6]

for srcuser in sourceusers:    if not srcuser.username in systemusers:        if srcuser.username is not target_admin_username: #don't delete the account used to connect            try:                targetusr = target.users.get(srcuser.username)                if targetusr is not None:                    print('Deleting user: ' + targetusr.fullname)                    targetusr.reassign_to(target_admin_username)                    targetusr.delete()            except:                print('User {} does not exist in Target Portal'.format(srcuser.username))

if I use targetusr.fullname, it always go to the exception, and never delete the user. But if I use targetusr.fullName I can delete the user without problem.

Is this expected?

0 Kudos
1 Solution

Accepted Solutions
RohitSingh2
Esri Contributor

You're right - it should be targetuser.fullName not targetuser.fullname.

We'll fix this in the sample and the developer website. Thanks for pointing it out.

Rohit

View solution in original post

1 Reply
RohitSingh2
Esri Contributor

You're right - it should be targetuser.fullName not targetuser.fullname.

We'll fix this in the sample and the developer website. Thanks for pointing it out.

Rohit