FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `identities` support for User creation · Issue #528 · python-gitlab/python-gitlab · GitHub

Repository navigation

Add identities support for User creation #528

Description

Description of the problem, including code/CLI snippet

user_data = {
    'email': 'donald.duck@yopmail.com',
    'username': 'donald',
    'password': 'defaultpassword',
    'name': 'Donald Duck',
    'can_create_group': 'false',
    'skip_confirmation': 'true',
    'identities': [{'provider':'oauth2_generic', 'extern_uid':'3'}] # User with email `donald.duck@yopmail.com` and UID `3` already lives on the OAuth2 server
}

user = gl.users.create(user_data) # Success

user.identities # [] <--

Expected Behavior

user.identities == [{'provider':'oauth2_generic', 'extern_uid':'3'}]

Actual Behavior

user.identities == []

Specifications

  • python-gitlab version: 1.4.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 10.4.2

Activity

  1. raphaelyancey commented on Jun 12, 2018

    Author

    Found it, my bad. Was trying to set it with an array whereas the API doc clearly shows that it's first-level props. To add more identities, rince and repeat (or issue a PUT request).

    u = gl.users.get(29)
    u.provider = "oauth2_generic"
    u.extern_uid = "3"
    u.save()
  2. gpocentek commented on Jun 12, 2018

    Contributor

    Hi @raphaelyancey

    If that's OK with you I'll add the code sample you provided in the python-gitlab docs. This can probably be useful for other users.

  3. raphaelyancey commented on Jun 12, 2018

    Author

    @gpocentek Of course, go ahead!

  4. added this to the v1.5 milestone on Jun 17, 2018
  5. added a commit that references this issue on Jun 17, 2018
    21e382b
  6. locked as resolved and limited conversation to collaborators on Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL