retrieve laboratories data again if the token has been expied.
This commit is contained in:
parent
fb8dfbef10
commit
06a91de15e
@ -20,7 +20,7 @@ def create_session(remote: str) -> MDRSSession:
|
|||||||
|
|
||||||
|
|
||||||
def find_laboratory(session: MDRSSession, laboratory_name: str) -> Laboratory:
|
def find_laboratory(session: MDRSSession, laboratory_name: str) -> Laboratory:
|
||||||
if session.laboratories.empty():
|
if session.laboratories.empty() or session.token is not None and session.token.is_expired:
|
||||||
laboratory_api = LaboratoryApi(session)
|
laboratory_api = LaboratoryApi(session)
|
||||||
session.laboratories = laboratory_api.list()
|
session.laboratories = laboratory_api.list()
|
||||||
laboratory = session.laboratories.find_by_name(laboratory_name)
|
laboratory = session.laboratories.find_by_name(laboratory_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user