mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-28 18:21:00 +00:00
return 410 Gone for deleted identity
This commit is contained in:
parent
7c34ac78ed
commit
02bda3ad9b
2 changed files with 6 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue