How to change the manager of a user? #1058
matmisie-gemini
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to update the manager of a user using this library but I cannot get it to work.
I am able to update other simple properties like first_name.
Please see below more or less how the code looks.
Anybody knows how to use it?
Thanks so much for your help
`class Employee(BaseModel):
first_name: Optional[str] = None
email: str
manager_email: Optional[str] = None
...
update_data = User(
first_name=employee.first_name,
)
manager = self.client.users.by_user_id(employee.manager_email).get()
if manager:
update_data.manager = manager
else:
update_data.manager = None
self.client.users.by_user_id(employee.email).patch(update_data)`
Beta Was this translation helpful? Give feedback.
All reactions