summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-20 12:51:15 -0700
committerAndrew Godwin2022-11-20 12:51:15 -0700
commit94d92fdf8a62c3cdc277d82c15a450f62ab7ee3b (patch)
tree9961738163c39d87ca420521e2ca3972b36b9ef7
parent2d7f33879f9319cd47aae0d6fe8486a7c6d0c95b (diff)
downloadtakahe-94d92fdf8a62c3cdc277d82c15a450f62ab7ee3b.tar.gz
takahe-94d92fdf8a62c3cdc277d82c15a450f62ab7ee3b.tar.bz2
takahe-94d92fdf8a62c3cdc277d82c15a450f62ab7ee3b.zip
Handle remote user deletions
-rw-r--r--users/models/identity.py4
1 files changed, 4 insertions, 0 deletions
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)