@click.command('<STR_LIT:user>', short_help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>required=True,<EOL>multiple=True<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', required=True)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', required=True)<EOL>@click.option('<STR_LIT>',<EOL>is_flag=True,<EOL>help="<STR_LIT>",<EOL>)<EOL>@click.pass_context<EOL>def user(context, institute_id, user_name, user_mail, admin):
adapter = context.obj['<STR_LIT>']<EOL>institutes = []<EOL>for institute in institute_id:<EOL><INDENT>institute_obj = adapter.institute(institute_id=institute)<EOL>if not institute_obj:<EOL><INDENT>LOG.warning("<STR_LIT>", institute)<EOL>context.abort()<EOL><DEDENT>institutes.append(institute)<EOL><DEDENT>roles = []<EOL>if admin:<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>roles.append('<STR_LIT>')<EOL><DEDENT>user_info = dict(email=user_mail.lower(), name=user_name, roles=roles, institutes=institutes)<EOL>user_obj = build_user(user_info)<EOL>try:<EOL><INDENT>adapter.add_user(user_obj)<EOL><DEDENT>except Exception as err:<EOL><INDENT>LOG.warning(err)<EOL>context.abort()<EOL><DEDENT>
Add a user to the database.