Skip to content

Commit fa46397

Browse files
jacalataclaude
andauthored
fix: don't default authSetting to ServerDefault in bulk user add (#1779)
* fix: don't default authSetting to ServerDefault in bulk user add ServerDefault is wrong for Tableau Cloud. Match the single-user add/update behaviour and only send authSetting when explicitly set. Fixes #1777 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: update test to match corrected bulk add authSetting behaviour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0098271 commit fa46397

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tableauserverclient/server/request_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,8 @@ def import_from_csv_req(self, csv_content: bytes, users: Iterable[UserItem]):
10051005
raise ValueError("User cannot have both authSetting and idpConfigurationId.")
10061006
elif user.idp_configuration_id is not None:
10071007
user_element.attrib["idpConfigurationId"] = user.idp_configuration_id
1008-
else:
1009-
user_element.attrib["authSetting"] = user.auth_setting or "ServerDefault"
1008+
elif user.auth_setting is not None:
1009+
user_element.attrib["authSetting"] = user.auth_setting
10101010

10111011
parts = {
10121012
"tableau_user_import": ("tsc_users_file.csv", csv_content, "file"),

test/test_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def test_bulk_add(server: TSC.Server) -> None:
467467
for user, xml_user in zip(users, xml_users):
468468
assert user.name == xml_user.get("name")
469469
if user.idp_configuration_id is None:
470-
assert xml_user.get("authSetting") == (user.auth_setting or "ServerDefault")
470+
assert xml_user.get("authSetting") == user.auth_setting
471471
else:
472472
assert xml_user.get("idpConfigurationId") == user.idp_configuration_id
473473
assert xml_user.get("authSetting") is None

0 commit comments

Comments
 (0)