diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 5a8419e63aa..e5779f05818 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -471,7 +471,8 @@ def __setLatestResouceVersionsForVersionUpgrade(self): ("definition_changes", InstanceContainer.Version * 1000000 + self.SettingVersion): (self.ResourceTypes.DefinitionChangesContainer, "application/x-uranium-instancecontainer"), ("variant", InstanceContainer.Version * 1000000 + self.SettingVersion): (self.ResourceTypes.VariantInstanceContainer, "application/x-uranium-instancecontainer"), ("setting_visibility", SettingVisibilityPresetsModel.Version * 1000000 + self.SettingVersion): (self.ResourceTypes.SettingVisibilityPreset, "application/x-uranium-preferences"), - ("machine", 2): (Resources.DefinitionContainers, "application/x-uranium-definitioncontainer") + ("machine", 2): (Resources.DefinitionContainers, "application/x-uranium-definitioncontainer"), + ("extruder", 2): (Resources.DefinitionContainers, "application/x-uranium-definitioncontainer") } ) diff --git a/cura/OAuth2/AuthorizationHelpers.py b/cura/OAuth2/AuthorizationHelpers.py index df3fc366ba5..d6f4980fe44 100644 --- a/cura/OAuth2/AuthorizationHelpers.py +++ b/cura/OAuth2/AuthorizationHelpers.py @@ -3,7 +3,7 @@ from datetime import datetime import json -import random +import secrets from hashlib import sha512 from base64 import b64encode from typing import Optional @@ -139,11 +139,11 @@ def parseJWT(self, access_token: str) -> Optional["UserProfile"]: def generateVerificationCode(code_length: int = 32) -> str: """Generate a verification code of arbitrary length. - :param code_length:: How long should the code be? This should never be lower than 16, but it's probably + :param code_length:: How long should the code be in bytes? This should never be lower than 16, but it's probably better to leave it at 32 """ - return "".join(random.choice("0123456789ABCDEF") for i in range(code_length)) + return secrets.token_hex(code_length) @staticmethod def generateVerificationCodeChallenge(verification_code: str) -> str: diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index c12e364339a..0c2f80fb378 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -114,9 +114,9 @@ Cura.ExpandablePopup anchors { bottom: parent.bottom - bottomMargin: - height * 1 / 6 + bottomMargin: - Math.round(height * 1 / 6) left: parent.left - leftMargin: iconSize - width * 5 / 6 + leftMargin: iconSize - Math.round(width * 5 / 6) } source: