diff --git a/synadm/api.py b/synadm/api.py index 524ef42a..d89f4a19 100644 --- a/synadm/api.py +++ b/synadm/api.py @@ -672,11 +672,11 @@ def user_reactivate(self, user_id, password=None): # TODO: handling errors when password is required? pass - def user_lock(self, user_id): - return self._user_modify_api(user_id, {"locked": True}) - - def user_unlock(self, user_id): - return self._user_modify_api(user_id, {"locked": False}) + def user_set_lock(self, user_id, locked): + """ + Lock or unlock an account. + """ + return self._user_modify_api(user_id, {"locked": locked}) def user_set_admin(self, user_id, admin): return self._user_modify_api(user_id, {"admin": admin}) diff --git a/synadm/cli/user.py b/synadm/cli/user.py index fe8b60ec..5be2cc59 100644 --- a/synadm/cli/user.py +++ b/synadm/cli/user.py @@ -574,7 +574,7 @@ def lock(helper, user_id): Lock a user account, preventing them from logging in or using the account. """ - result = helper.api.user_lock(user_id) + result = helper.api.user_set_lock(user_id, True) helper.output(result) @@ -586,7 +586,7 @@ def unlock(helper, user_id): Unlock a user account, allowing a locked account to log in and use the account. """ - result = helper.api.user_unlock(user_id) + result = helper.api.user_set_lock(user_id, False) helper.output(result)