Calling gl.users.list with a username for someone who doesn't exist #2232
Unanswered
willnwalker
asked this question in
Q&A
Replies: 1 comment 3 replies
-
@willnwalker could you format your code and maybe add a little more for context? Generally project membership does not have much to do with the actual user creation at instance-level so I don't see that being an issue with python-gitlab unless you also use it to create users at instance level. I'd say it's likely more to do with how external identities are used to create the user with SSO. A little more code would help us get a better idea though! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
When attempting to run our code fragment which tries to add a user to a newly-created repository, we get an exception whenever that user does not yet exist (as expected). However, when the user goes to sign in via SSO and an account is created for them for the first time, their username has a 1 appended to it (seemingly due to a conflict from when the script searched for the user on our Gitlab instance). Has anyone else experienced this weird behavior before? We are trying to determine if the fault lies with our script, python-gitlab, or Gitlab. I was unable to find anything in the issues for this project or Gitlab.
try: u = gl.users.list (username=user)[0] allowed_users.append (u.id)
except: print (' {0}: User {1} doesn\'t (yet) exist ... skipping'.format (repo_fullname, user))
Beta Was this translation helpful? Give feedback.
All reactions