From cb8804b86a5ee2faafa256ddb8b0107d641e68d0 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 20 Feb 2019 10:46:15 +0100 Subject: [PATCH] Revert "Add some kaizen changes from #5328" This reverts commit 09fe06b8bf463fd0805fa767bbe34087adc0c700. --- cura/OAuth2/AuthorizationService.py | 6 +++++- plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py | 6 +----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index 442c5d388d..3c2f66d037 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -66,7 +66,11 @@ class AuthorizationService: # \sa _parseJWT def getUserProfile(self) -> Optional["UserProfile"]: if not self._user_profile: - 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. diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py index 87c7a50838..adff94bbbc 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py @@ -159,13 +159,9 @@ class CloudApiClient: model: Type[CloudApiClientModel], ) -> 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) self._anti_gc_callbacks.remove(parse) - self._parseModels(response, on_finished, model) - return + return self._parseModels(response, on_finished, model) self._anti_gc_callbacks.append(parse) reply.finished.connect(parse)