mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
session instance validation also checks for process session and raises exception if does not match ftrack_api session
This commit is contained in:
parent
28f2d14318
commit
bcf8bf17a5
1 changed files with 8 additions and 8 deletions
|
|
@ -32,18 +32,18 @@ class BaseHandler(object):
|
|||
def __init__(self, session, plugins_presets={}):
|
||||
'''Expects a ftrack_api.Session instance'''
|
||||
self.log = Logger().get_logger(self.__class__.__name__)
|
||||
if not isinstance(session, ftrack_api.session.Session):
|
||||
self.log.warning((
|
||||
if not(
|
||||
isinstance(session, ftrack_api.session.Session) or
|
||||
isinstance(session, ProcessSession)
|
||||
):
|
||||
raise Exception((
|
||||
"Session object entered with args is instance of \"{}\""
|
||||
" but expected instance is \"{}\"."
|
||||
" but expected instances are \"{}\" and \"{}\""
|
||||
).format(
|
||||
str(type(session)),
|
||||
str(ftrack_api.session.Session.__qualname__)
|
||||
str(ftrack_api.session.Session),
|
||||
str(ProcessSession)
|
||||
))
|
||||
self.register = self.register_without_session
|
||||
self._session = None
|
||||
|
||||
return
|
||||
|
||||
self._session = session
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue