From a3b391ee3c68c02cd0cee0fe777bdc8ad027bd6b Mon Sep 17 00:00:00 2001 From: Iam54r1n4 Date: Sat, 25 Jan 2025 15:07:27 +0000 Subject: [PATCH] Fix cli_api.py type hints bugs --- core/cli_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cli_api.py b/core/cli_api.py index cdab689..35286b5 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -165,7 +165,7 @@ def get_user(username: str) -> dict | None: return json.loads(res) -def add_user(username: str, traffic_limit: int, expiration_days: int, password: str, creation_date: str): +def add_user(username: str, traffic_limit: int, expiration_days: int, password: str | None, creation_date: str | None): """ Adds a new user with the given parameters. """ @@ -176,7 +176,7 @@ def add_user(username: str, traffic_limit: int, expiration_days: int, password: run_cmd(['bash', Command.ADD_USER.value, username, str(traffic_limit), str(expiration_days), password, creation_date]) -def edit_user(username: str, new_username: str, new_traffic_limit: int, new_expiration_days: int, renew_password: bool, renew_creation_date: bool, blocked: bool): +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): """ Edits an existing user's details. """