From dc59b61fba6f936298a4074337ffb2e3da9bd587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Mon, 11 Apr 2022 10:20:02 +0200 Subject: [PATCH] Revert changes to pgp_utils --- app/pgp_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/pgp_utils.py b/app/pgp_utils.py index 8934ddec..211ec00d 100644 --- a/app/pgp_utils.py +++ b/app/pgp_utils.py @@ -65,7 +65,7 @@ def encrypt_file(data: BytesIO, fingerprint: str) -> str: LOG.d("mem_usage %s", mem_usage) r = gpg.encrypt_file(data, fingerprint, always_trust=True) - if not r.success: + if not r.ok: # maybe the fingerprint is not loaded on this host, try to load it found = False # searching for the key in mailbox @@ -87,7 +87,7 @@ def encrypt_file(data: BytesIO, fingerprint: str) -> str: data.seek(0) r = gpg.encrypt_file(data, fingerprint, always_trust=True) - if not r.success: + if not r.ok: raise PGPException(f"Cannot encrypt, status: {r.status}") return str(r)