1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 22:56:15 +01:00

Merge pull request #1188 from mig4/fix-delete-pass

Avoid crash when deleting a password
This commit is contained in:
Daniel Mach 2022-11-04 11:13:26 +01:00 committed by GitHub
commit cd257dc15f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,7 +246,11 @@ class KeyringCredentialsManager(AbstractCredentialsManager):
def delete_password(self, url, user):
self._load_backend()
keyring.delete_password(urlsplit(url)[1], user)
service = urlsplit(url)[1]
data = keyring.get_password(service, user)
if data is None:
return
keyring.delete_password(service, user)
class KeyringCredentialsDescriptor(AbstractCredentialsManagerDescriptor):