Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into mb-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
burtoogle committed Sep 4, 2021
2 parents 676f797 + d5481e4 commit 9e0f6ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
)

Expand Down
6 changes: 3 additions & 3 deletions cura/OAuth2/AuthorizationHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions resources/qml/PrinterSelector/MachineSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9e0f6ea

Please sign in to comment.