Small code style improvements
This commit is contained in:
parent
ac446c7746
commit
24551c7d41
@ -17,12 +17,12 @@ def api_auth():
|
|||||||
credentials['email'] = os.getenv('ACCESS_CONTROLLER_API_EMAIL')
|
credentials['email'] = os.getenv('ACCESS_CONTROLLER_API_EMAIL')
|
||||||
|
|
||||||
# prefer token, use password if token not provided
|
# prefer token, use password if token not provided
|
||||||
if token is not None:
|
if token:
|
||||||
credentials['token'] = token
|
credentials['token'] = token
|
||||||
else:
|
elif password:
|
||||||
if password is None:
|
|
||||||
raise ValueError('access_controller token or password not in env')
|
|
||||||
credentials['password'] = password
|
credentials['password'] = password
|
||||||
|
else:
|
||||||
|
raise ValueError('access_controller token or password not in env')
|
||||||
|
|
||||||
zenpy_client = Zenpy(**credentials)
|
zenpy_client = Zenpy(**credentials)
|
||||||
zenpy_user: ZenpyUser = zenpy_client.users.search(email).values[0]
|
zenpy_user: ZenpyUser = zenpy_client.users.search(email).values[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user