Skip to content

Commit

Permalink
allow leaving password unchanged
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud committed Apr 22, 2020
1 parent 6585a20 commit 5871a78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions arrow/commands/users/update_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
@click.argument("email", type=str)
@click.argument("first_name", type=str)
@click.argument("last_name", type=str)
@click.argument("password", type=str)
@click.option(
"--password",
help="User's password (omit to keep untouched)",
type=str
)
@click.option(
"--metadata",
help="User metadata",
Expand All @@ -21,11 +25,11 @@
@pass_context
@custom_exception
@dict_output
def cli(ctx, email, first_name, last_name, password, metadata={}, new_email=""):
def cli(ctx, email, first_name, last_name, password="", metadata={}, new_email=""):
"""Update an existing user
Output:
a dictionary containing user information
"""
return ctx.gi.users.update_user(email, first_name, last_name, password, metadata=metadata, new_email=new_email)
return ctx.gi.users.update_user(email, first_name, last_name, password=password, metadata=metadata, new_email=new_email)
3 changes: 2 additions & 1 deletion docs/commands/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Update the permissions of a user on a specified organism

**Usage**::

arrow users update_user [OPTIONS] EMAIL FIRST_NAME LAST_NAME PASSWORD
arrow users update_user [OPTIONS] EMAIL FIRST_NAME LAST_NAME

**Help**

Expand All @@ -286,6 +286,7 @@ Update an existing user
**Options**::


--password TEXT User's password (omit to keep untouched)
--metadata TEXT User metadata
--new_email TEXT User's new email (if you want to change it)
-h, --help Show this message and exit.
Expand Down

0 comments on commit 5871a78

Please sign in to comment.