mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:15:54 +08:00
parent
a11878b199
commit
09fe06b8bf
@ -66,11 +66,7 @@ class AuthorizationService:
|
|||||||
# \sa _parseJWT
|
# \sa _parseJWT
|
||||||
def getUserProfile(self) -> Optional["UserProfile"]:
|
def getUserProfile(self) -> Optional["UserProfile"]:
|
||||||
if not self._user_profile:
|
if not self._user_profile:
|
||||||
try:
|
|
||||||
self._user_profile = self._parseJWT()
|
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 not self._user_profile and self._auth_data:
|
||||||
# If there is still no user profile from the JWT, we have to log in again.
|
# If there is still no user profile from the JWT, we have to log in again.
|
||||||
|
@ -159,9 +159,13 @@ class CloudApiClient:
|
|||||||
model: Type[CloudApiClientModel],
|
model: Type[CloudApiClientModel],
|
||||||
) -> None:
|
) -> None:
|
||||||
def parse() -> None:
|
def parse() -> None:
|
||||||
|
# Don't try to parse the reply if we didn't get one
|
||||||
|
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) is None:
|
||||||
|
return
|
||||||
status_code, response = self._parseReply(reply)
|
status_code, response = self._parseReply(reply)
|
||||||
self._anti_gc_callbacks.remove(parse)
|
self._anti_gc_callbacks.remove(parse)
|
||||||
return self._parseModels(response, on_finished, model)
|
self._parseModels(response, on_finished, model)
|
||||||
|
return
|
||||||
|
|
||||||
self._anti_gc_callbacks.append(parse)
|
self._anti_gc_callbacks.append(parse)
|
||||||
reply.finished.connect(parse)
|
reply.finished.connect(parse)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user