Trying to change culture (en-US, etc) of users in Portal via Python

07-19-2021 08:56 AM
Labels (1)
New Contributor



I am trying to change the culture (en-GB, etc) for users in our Portal via Python. We found that a global change via the organization settings does not hold for existing users. My attempted code is the following:


from arcgis.gis import GIS

portal = GIS(url="", username="my_username", password="my_password")

users_list =" ", max_users=10000)

for i in users_list:
user = i
user_name = user.username
user_culture = user.culture
if user_culture == "en-US":
new_culture = user_culture.replace('en-US', 'en-GB')
user.update(user={"culture": new_culture})
print(user_name, ',', user_culture)

 I am met with the following error:

Traceback (most recent call last):
File "path_to_python_script", line 19, in <module>
user.update(user={"culture": new_culture})
TypeError: update() got an unexpected keyword argument 'user'


Thanks in advance.


0 Kudos
0 Replies