From 24551c7d416ee8bde5a8424661f6dfc967a90cb8 Mon Sep 17 00:00:00 2001 From: Andrew Smirnov Date: Thu, 11 Feb 2021 20:30:35 +0300 Subject: [PATCH] Small code style improvements --- main/apiauth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/apiauth.py b/main/apiauth.py index db9bf14..4e3f761 100644 --- a/main/apiauth.py +++ b/main/apiauth.py @@ -17,12 +17,12 @@ def api_auth(): credentials['email'] = os.getenv('ACCESS_CONTROLLER_API_EMAIL') # prefer token, use password if token not provided - if token is not None: + if token: credentials['token'] = token - else: - if password is None: - raise ValueError('access_controller token or password not in env') + elif password: credentials['password'] = password + else: + raise ValueError('access_controller token or password not in env') zenpy_client = Zenpy(**credentials) zenpy_user: ZenpyUser = zenpy_client.users.search(email).values[0]