Merge branch '4.0'

This commit is contained in:
Ghostkeeper 2019-02-08 11:28:06 +01:00
commit 473633de2c
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
4 changed files with 11 additions and 5 deletions

View file

@ -5,6 +5,8 @@ import json
import webbrowser
from typing import Optional, TYPE_CHECKING
from urllib.parse import urlencode
import requests.exceptions
from UM.Logger import Logger
from UM.Signal import Signal
@ -49,7 +51,11 @@ class AuthorizationService:
def getUserProfile(self) -> Optional["UserProfile"]:
if not self._user_profile:
# If no user profile was stored locally, we try to get it from JWT.
self._user_profile = self._parseJWT()
try:
self._user_profile = self._parseJWT()
except requests.exceptions.ConnectionError:
# Unable to get connection, can't login.
return None
if not self._user_profile and self._auth_data:
# If there is still no user profile from the JWT, we have to log in again.