Compare commits

...

2 commits

Author SHA1 Message Date
Henri Dickson 5a025b8be4
Merge 02bda3ad9b into 7c34ac78ed 2024-02-20 02:58:10 +00:00
Henri Dickson 02bda3ad9b return 410 Gone for deleted identity 2024-02-19 21:57:57 -05:00
2 changed files with 6 additions and 3 deletions

View file

@ -55,7 +55,7 @@ class IdentityStates(StateGraph):
edited = State(try_interval=300, attempt_immediately=True)
deleted = State(try_interval=300, attempt_immediately=True)
deleted_fanned_out = State(delete_after=86400 * 7)
deleted_fanned_out = State(externally_progressed=True)
moved = State(try_interval=300, attempt_immediately=True)
moved_fanned_out = State(externally_progressed=True)
@ -582,7 +582,7 @@ class Identity(StatorModel):
self.ensure_uris()
response = {
"id": self.actor_uri,
"type": self.actor_type.title(),
"type": "Tombstone" if self.deleted else self.actor_type.title(),
"inbox": self.inbox_uri,
"outbox": self.outbox_uri,
"featured": self.featured_collection_uri,

View file

@ -64,10 +64,13 @@ class ViewIdentity(ListView):
# If this not a local actor, redirect to their canonical URI
if not identity.local:
return redirect(identity.actor_uri)
return JsonResponse(
r = JsonResponse(
canonicalise(identity.to_ap(), include_security=True),
content_type="application/activity+json",
)
if identity.deleted:
r.status_code = 410
return r
def get_queryset(self):
return TimelineService(None).identity_public(