mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 03:05:57 +08:00
Fix incorrect typing in keyring attribute
It didn't need Type["basemodel"] but a direct base model
This commit is contained in:
parent
00a360aca6
commit
17d8751ec1
@ -30,7 +30,7 @@ class KeyringAttribute:
|
|||||||
"""
|
"""
|
||||||
Descriptor for attributes that need to be stored in the keyring. With Fallback behaviour to the preference cfg file
|
Descriptor for attributes that need to be stored in the keyring. With Fallback behaviour to the preference cfg file
|
||||||
"""
|
"""
|
||||||
def __get__(self, instance: Type["BaseModel"], owner: type) -> str:
|
def __get__(self, instance: BaseModel, owner: type) -> str:
|
||||||
if self._store_secure:
|
if self._store_secure:
|
||||||
try:
|
try:
|
||||||
value = keyring.get_password("cura", self._keyring_name)
|
value = keyring.get_password("cura", self._keyring_name)
|
||||||
@ -42,7 +42,7 @@ class KeyringAttribute:
|
|||||||
else:
|
else:
|
||||||
return getattr(instance, self._name)
|
return getattr(instance, self._name)
|
||||||
|
|
||||||
def __set__(self, instance: Type["BaseModel"], value: str):
|
def __set__(self, instance: BaseModel, value: str):
|
||||||
if self._store_secure:
|
if self._store_secure:
|
||||||
setattr(instance, self._name, None)
|
setattr(instance, self._name, None)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user