Fixes deletion
This commit is contained in:
parent
08c1553e71
commit
b393df8cab
3 changed files with 16 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
''' note serializer and children thereof '''
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict, List
|
||||
from django.apps import apps
|
||||
|
||||
from .base_activity import ActivityObject, Link
|
||||
from .image import Image
|
||||
|
@ -10,6 +11,11 @@ class Tombstone(ActivityObject):
|
|||
''' the placeholder for a deleted status '''
|
||||
type: str = 'Tombstone'
|
||||
|
||||
def to_model(self, *args, **kwargs):
|
||||
''' this should never really get serialized, just searched for '''
|
||||
model = apps.get_model('bookwyrm.Status')
|
||||
return model.find_existing_by_remote_id(self.id)
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
class Note(ActivityObject):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue