Create user with indico shell, but not provide login details

If I manually create a user via the gui, I can click the “Set login details” button so that I don’t have to assign a username and password. This is useful for provisioning profiles of our SSO users who have not logged in yet, but whom we want to be able to add to events.

But when I create a user with the indico shell, I am prompted for username and password, and cannot leave them blank. Is there an option for not assigning login details when using the shell?

Sounds like a good idea. Pull request welcome :wink:

My python is a little rusty, but I’ll have a look.

Here’s another, related one:
I don’t seem to be able to specify name, affiliation, etc, through the command-line options when I do ‘indico user create’

Looking at the code for user.py it has

@click.option('--first-name', '-n', help='First name of the user')
@click.option('--last-name', '-s', help='Last name of the user')
@click.option('--email', '-e', help='Email address of the user')
@click.option('--affiliation', '-a', help='Affiliation of the user')

but none of these options is recognized during user creation.

If these things were implemented, a bulk user import feature could work. Otherwise it is still typing them in one at a time, whether I use the GUI or the shell.

You’re looking at the user search CLI, not the user creation CLI :wink:

Check this function instead:

Thanks. But my reading of this is that it is not currently possible to specify the name, email, and affiliation non-interactively. Is that right?

That’s correct; so far nobody really needed to use this to automatically create users. At least in a Python script it would be much easier to just call the create_user() util directly instead of going through the indico cli.

As soon as you need to do this in a loop for more than one user you’d also get significantly better performance, since invoking the indico cli is rather heavy/slow.