From 94d92fdf8a62c3cdc277d82c15a450f62ab7ee3b Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Nov 2022 12:51:15 -0700 Subject: Handle remote user deletions --- users/models/identity.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'users') diff --git a/users/models/identity.py b/users/models/identity.py index c26762d..510b947 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -327,6 +327,10 @@ class Identity(StatorModel): ) except httpx.RequestError: return False + if response.status_code == 410: + # Their account got deleted, so let's do the same. + await Identity.objects.filter(pk=self.pk).adelete() + return False if response.status_code >= 400: return False document = canonicalise(response.json(), include_security=True) -- cgit v1.2.3