Small code style improvements

This commit is contained in:
Andrew Smirnov 2021-02-11 20:30:35 +03:00
parent ac446c7746
commit 24551c7d41
No known key found for this signature in database
GPG Key ID: 0EFE318E5BB2A82A

View File

@ -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]