From ff38948b2f673e4accd3a009164fb8b0140908a4 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 22 Dec 2022 05:59:07 +0000 Subject: [PATCH] Handle language'd public keys --- users/models/identity.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/users/models/identity.py b/users/models/identity.py index 2318057..9d393a6 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -644,6 +644,9 @@ class Identity(StatorModel): self.manually_approves_followers = document.get("manuallyApprovesFollowers") self.public_key = document.get("publicKey", {}).get("publicKeyPem") self.public_key_id = document.get("publicKey", {}).get("id") + # Sometimes the public key PEM is in a language construct? + if isinstance(self.public_key, dict): + self.public_key = self.public_key["@value"] self.icon_uri = get_first_image_url(document.get("icon", None)) self.image_uri = get_first_image_url(document.get("image", None)) self.discoverable = document.get("toot:discoverable", True)