Skip to content

Commit

Permalink
implement user reactivate
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonChen666 committed Oct 10, 2023
1 parent 36585ab commit ebba88f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 6 additions & 3 deletions synadm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,12 @@ def user_reactivate(self, user_id, password=None):
password (str or None): A password. Required under certain
conditions.
"""
# TODO
# TODO: handling errors when password is required?
pass
data = {
"deactivated": False
}
if password != None:
data["password"] = password
return self._user_modify_api(user_id, data)

def user_set_lock(self, user_id, locked):
"""
Expand Down
12 changes: 7 additions & 5 deletions synadm/cli/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,14 @@ def set_display_name(helper, user_id, display_name):

@user.command()
@click.argument("user_id", type=str)
# TODO: check compatibility with --batch
@click.password_option(required=False,
help="""The new password to set to. This is required when reactivating a
user on a Synapse installation with passwords enabled.""")
@click.pass_obj
def reactivate(helper, user_id):
# TODO
# TODO: does this require a password? merge into password? user
# experience?
pass
def reactivate(helper, user_id, password):
result = helper.api.user_reactivate(user_id, password)
helper.output(result)


@user.command()
Expand Down

0 comments on commit ebba88f

Please sign in to comment.