From 0c73c519363ccba5170921e3865e7ca24f2b2a87 Mon Sep 17 00:00:00 2001 From: profitroll Date: Mon, 3 Jul 2023 14:42:55 +0200 Subject: [PATCH] unauthorized_client will be created when needed --- modules/cli.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/cli.py b/modules/cli.py index e21ee0e..41dfb82 100644 --- a/modules/cli.py +++ b/modules/cli.py @@ -27,13 +27,14 @@ parser.add_argument("--create-album", action="store_true") args = parser.parse_args() -unauthorized_client = Client( - base_url=sync.config_get("address", "posting", "api"), - timeout=5.0, - verify_ssl=True, - raise_on_unexpected_status=True, - follow_redirects=False, -) +if args.create_user or args.create_album: + unauthorized_client = Client( + base_url=sync.config_get("address", "posting", "api"), + timeout=5.0, + verify_ssl=True, + raise_on_unexpected_status=True, + follow_redirects=False, + ) async def cli_create_user() -> None: