Fixed typing issues

Contributes to: CURA-8539
This commit is contained in:
Jelle Spijker 2021-11-23 13:18:42 +01:00
parent 0a43366ffc
commit 36e28a245c
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A

View file

@ -3,7 +3,7 @@
import json import json
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Callable, Dict, Optional, TYPE_CHECKING from typing import Callable, Dict, Optional, TYPE_CHECKING, Union
from urllib.parse import urlencode, quote_plus from urllib.parse import urlencode, quote_plus
from PyQt5.QtCore import QUrl from PyQt5.QtCore import QUrl
@ -15,7 +15,7 @@ from UM.Signal import Signal
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers, TOKEN_TIMESTAMP_FORMAT from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers, TOKEN_TIMESTAMP_FORMAT
from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer
from cura.OAuth2.Models import AuthenticationResponse from cura.OAuth2.Models import AuthenticationResponse, BaseModel
i18n_catalog = i18nCatalog("cura") i18n_catalog = i18nCatalog("cura")
@ -117,7 +117,7 @@ class AuthorizationService:
callback(user_profile) callback(user_profile)
return return
# The JWT was expired or invalid and we should request a new one. # The JWT was expired or invalid and we should request a new one.
if self._auth_data.refresh_token is None: if self._auth_data is None or self._auth_data.refresh_token is None:
Logger.warning("There was no refresh token in the auth data.") Logger.warning("There was no refresh token in the auth data.")
callback(None) callback(None)
return return