From 526eb8dacdc33a7f7b31f7d4b0f09cf006493d35 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 3 Nov 2020 09:48:54 +0100 Subject: [PATCH 1/4] Gracefully handle exceptions in arrange CURA-7785 --- cura/CuraApplication.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 24acf08d74..0411343855 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1901,9 +1901,10 @@ class CuraApplication(QtApplication): if select_models_on_load: Selection.add(node) - - arrange(nodes_to_arrange, self.getBuildVolume(), fixed_nodes) - + try: + arrange(nodes_to_arrange, self.getBuildVolume(), fixed_nodes) + except: + Logger.logException("e", "Failed to arrange the models") self.fileCompleted.emit(file_name) def addNonSliceableExtension(self, extension): From 4866127e502eca7cf30599c111d1b37784408e35 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 3 Nov 2020 14:36:27 +0100 Subject: [PATCH 2/4] Send None instead of empty string. --- plugins/SliceInfoPlugin/SliceInfo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 61fc777290..0e431b77d8 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -125,7 +125,8 @@ class SliceInfo(QObject, Extension): data["schema_version"] = 0 data["cura_version"] = self._application.getVersion() data["cura_build_type"] = ApplicationMetadata.CuraBuildType - data["organization_id"] = user_profile.get("organization_id", None) if user_profile else None + org_id = user_profile.get("organization_id", None) if user_profile else None + data["organization_id"] = org_id if len(org_id) > 0 else None data["subscriptions"] = user_profile.get("subscriptions", []) if user_profile else [] active_mode = self._application.getPreferences().getValue("cura/active_mode") From 0c7e31ece5e72d3433b7e108789e44307b2ccafc Mon Sep 17 00:00:00 2001 From: Remco Burema <41987080+rburema@users.noreply.github.com> Date: Tue, 3 Nov 2020 16:12:50 +0100 Subject: [PATCH 3/4] More readable. Co-authored-by: Jaime van Kessel --- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 0e431b77d8..6eed649cc7 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -126,7 +126,7 @@ class SliceInfo(QObject, Extension): data["cura_version"] = self._application.getVersion() data["cura_build_type"] = ApplicationMetadata.CuraBuildType org_id = user_profile.get("organization_id", None) if user_profile else None - data["organization_id"] = org_id if len(org_id) > 0 else None + data["organization_id"] = org_id if org_id else None data["subscriptions"] = user_profile.get("subscriptions", []) if user_profile else [] active_mode = self._application.getPreferences().getValue("cura/active_mode") From 881e4406a44ae45cb3ec54960dfc6f9b4d876078 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Wed, 4 Nov 2020 09:21:28 +0100 Subject: [PATCH 4/4] Ensure the organization_id is None --- cura/OAuth2/AuthorizationHelpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/OAuth2/AuthorizationHelpers.py b/cura/OAuth2/AuthorizationHelpers.py index b4ea2d8382..f7fe6958a1 100644 --- a/cura/OAuth2/AuthorizationHelpers.py +++ b/cura/OAuth2/AuthorizationHelpers.py @@ -127,7 +127,7 @@ class AuthorizationHelpers: user_id = user_data["user_id"], username = user_data["username"], profile_image_url = user_data.get("profile_image_url", ""), - organization_id = user_data.get("organization", {}).get("organization_id", ""), + organization_id = user_data.get("organization", {}).get("organization_id"), subscriptions = user_data.get("subscriptions", []) )