feat(core): add note editing functionality

- Updated `edit_user.py` to accept a `--note` argument, allowing user notes to be modified or cleared.
- Extended the `edit-user` command in `cli.py` with a `--note` option.
- Modified the `edit_user` function in `cli_api.py` to pass the new note argument to the underlying script.
This commit is contained in:
ReturnFI
2025-10-28 16:34:41 +00:00
parent ea75084eeb
commit dce23100a1
3 changed files with 14 additions and 5 deletions

View File

@ -311,7 +311,7 @@ def bulk_user_add(traffic_gb: float, expiration_days: int, count: int, prefix: s
run_cmd(command)
def edit_user(username: str, new_username: str | None, new_traffic_limit: int | None, new_expiration_days: int | None, renew_password: bool, renew_creation_date: bool, blocked: bool | None, unlimited_ip: bool | None):
def edit_user(username: str, new_username: str | None, new_traffic_limit: int | None, new_expiration_days: int | None, renew_password: bool, renew_creation_date: bool, blocked: bool | None, unlimited_ip: bool | None, note: str | None):
'''
Edits an existing user's details by calling the new edit_user.py script with named flags.
'''
@ -347,6 +347,9 @@ def edit_user(username: str, new_username: str | None, new_traffic_limit: int |
if unlimited_ip is not None:
command_args.extend(['--unlimited', 'true' if unlimited_ip else 'false'])
if note is not None:
command_args.extend(['--note', note])
run_cmd(command_args)