Verified Commit 7d68c50f authored by André's avatar André
Browse files

KEYRING_AVAILABLE: Only depend on selected backend

Passwords can only be stored if the selected backend is recommended.
parent b395ca61
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
keyring_backend = keyring.get_keyring() keyring_backend = keyring.get_keyring()
log.info('Select %s backend', keyring_backend) log.info('Select %s backend', keyring_backend)
KEYRING_AVAILABLE = any(keyring.core.recommended(backend) KEYRING_AVAILABLE = keyring.core.recommended(keyring_backend)
for backend in backends)
class SecretPasswordStorage: class SecretPasswordStorage:
......
...@@ -149,9 +149,8 @@ def _get_features(self): ...@@ -149,9 +149,8 @@ def _get_features(self):
@staticmethod @staticmethod
def _some_keyring_available(): def _some_keyring_available():
import keyring from gajim.common import passwords
backends = keyring.backend.get_all_keyring() return passwords.KEYRING_AVAILABLE
return any(keyring.core.recommended(backend) for backend in backends)
@staticmethod @staticmethod
def _idle_available(): def _idle_available():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment