mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
validate that the user exists on ftrack when ftrack credentials are checked
This commit is contained in:
parent
7df83e1f6a
commit
d02af55c05
1 changed files with 6 additions and 2 deletions
|
|
@ -92,14 +92,18 @@ def check_credentials(username, api_key, ftrack_server=None):
|
|||
if not ftrack_server or not username or not api_key:
|
||||
return False
|
||||
|
||||
user_exists = False
|
||||
try:
|
||||
session = ftrack_api.Session(
|
||||
server_url=ftrack_server,
|
||||
api_key=api_key,
|
||||
api_user=username
|
||||
)
|
||||
# Validated that the username actually exists
|
||||
user = session.query("User where username is \"{}\"".format(username))
|
||||
user_exists = user is not None
|
||||
session.close()
|
||||
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
pass
|
||||
return user_exists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue