~sircmpwn/sr.ht-dev

core: Fix adding gpg key with deleted ids. v1 APPLIED

Mehdi Sadeghi: 1
 Fix adding gpg key with deleted ids.

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/20084/mbox | git am -3
Learn more about email & git

[PATCH core] Fix adding gpg key with deleted ids. Export this patch

Some users have more than one id in their keys.
See https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C949e79a2-666a-617f-80ae-87795d9a6233%40mehdix.org%3E

Solution courtesy of Geoff Beier <geoff@tuxpup.com>
---
 srht/email.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srht/email.py b/srht/email.py
index 066aea5..e00d499 100644
--- a/srht/email.py
+++ b/srht/email.py
@@ -91,7 +91,7 @@ def prepare_email(body, to, subject, encrypt_key=None, **headers):
    else:
        pubkey, _ = pgpy.PGPKey.from_blob(encrypt_key.replace('\r', '').encode())
        pgp_msg = pgpy.PGPMessage.new(multipart.as_string(unixfrom=False))
        encrypted = str(pubkey.encrypt(pgp_msg))
        encrypted = str(pubkey.encrypt(pgp_msg, user=to))
        ver_part = Message()
        ver_part['Content-Type'] = 'application/pgp-encrypted'
        ver_part.set_payload("Version: 1")
-- 
2.30.0
Thanks!

To git@git.sr.ht:~sircmpwn/core.sr.ht
   a2246ea..2655a65  master -> master