Remove redundant activitypub dataclass

This commit is contained in:
Mouse Reeve 2021-02-19 11:16:01 -08:00
parent e707374888
commit fb98ef4b38
4 changed files with 4 additions and 10 deletions

View file

@ -15,7 +15,7 @@ from .response import ActivitypubResponse
from .book import Edition, Work, Author
from .verbs import Create, Delete, Undo, Update
from .verbs import Follow, Accept, Reject, Block
from .verbs import Add, AddBook, AddListItem, Remove
from .verbs import Add, AddListItem, Remove
from .verbs import Announce, Like
# this creates a list of all the Activity types that we can serialize,

View file

@ -132,13 +132,7 @@ class Add(Verb):
@dataclass(init=False)
class AddBook(Add):
'''Add activity that's aware of the book obj '''
object: Edition
@dataclass(init=False)
class AddListItem(AddBook):
class AddListItem(Add):
'''Add activity that's aware of the book obj '''
notes: str = None
order: int = 0

View file

@ -57,7 +57,7 @@ class ShelfBook(CollectionItemMixin, BookWyrmModel):
user = fields.ForeignKey(
'User', on_delete=models.PROTECT, activitypub_field='actor')
activity_serializer = activitypub.AddBook
activity_serializer = activitypub.Add
object_field = 'book'
collection_field = 'shelf'

View file

@ -50,7 +50,7 @@ class UserTag(CollectionItemMixin, BookWyrmModel):
tag = fields.ForeignKey(
'Tag', on_delete=models.PROTECT, activitypub_field='target')
activity_serializer = activitypub.AddBook
activity_serializer = activitypub.Add
object_field = 'book'
collection_field = 'tag'