8000 Why do I need to populate a Group with Users to add a new user? · Issue #67 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content
Why do I need to populate a Group with Users to add a new user? #67
Closed
@tableauembeddingteam

Description

@tableauembeddingteam

After about an hour of work, I am finally able to successfully add a new user and then add them to an existing group. However, I was perplexed by receiving an error about the Group not being populated:

My initial code:

with server.auth.sign_in(auth):
user = TSC.UserItem('stone_cold', 'Publisher')
new_user = server.users.add(user)
gs, pi = server.groups.get()
for g in gs:
if g.name == 'Ballers':
server.groups.add_user(g, new_user.id)

Working code:
with server.auth.sign_in(auth):
user = TSC.UserItem('stone_cold', 'Publisher')
new_user = server.users.add(user)
gs, pi = server.groups.get()
for g in gs:
if g.name == 'Ballers':
server.groups.populate_users(g)
server.groups.add_user(g, new_user.id)

Why do I need to use the populate_users() method on the Group just to add a user to it? As a second issue, why is populate_users() a Groups endpoint method and not a method of the GroupItem itself, where it could be called automatically prior to the attempt to add?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0