Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set value for custom attribute that was previously empty/null with update_user #201

Closed
warrenySC opened this issue May 5, 2021 · 4 comments

Comments

@warrenySC
Copy link

I am seeing this behavior when following the code sample from https://github.com/okta/okta-sdk-python#update-a-user

Repro steps:

  1. Create a custom attribute for the Okta profile
  2. Create a user in Okta admin dashboard
  3. Update the user profile using the SDK with code snippet below
  4. Observe that the attribute was not updated
  5. Edit the Okta profile in the UI and give the attribute a random value
  6. Re-run the code snippet
  7. Observe that the attribute has been updated
async def main():
    client = okta_client

    user, resp, err = await client.get_user('{user_id}')

    new_profile = user.profile
    new_profile.custom_attr= 'Foo'

    updated_user_obj = models.User({'profile': new_profile})
    print(updated_user_obj)
    # Update User with new details
    updated_user, _, err = await client.update_user(user.id, updated_user_obj)
    print(updated_user)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
@aarongranick-okta
Copy link

@warrenySC Thank you for the report. One of our Python engineers will investigate. (internal ref: OKTA-393273)

@serhiibuniak-okta
Copy link
Contributor

@warrenySC Thanks for providing a lot of details. As a temporary workaround you can try:

new_profile.custom_attr = 'Foo'
new_profile.custom_attributes.append("custom_attr")

Let me know if it works for you. Meanwhile, I'll investigate this issue.

@warrenySC
Copy link
Author

@serhiibuniak-okta I can confirm that the workaround is working for me. Thanks!

@serhiibuniak-okta
Copy link
Contributor

@warrenySC SDK v1.7.0 has been released. Now you can use custom attributes as usual. I'm closing this issue as resolved. Feel free to reopen this issue or create a new one if your problem still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants