forked from mirrors/bookwyrm
Remove redundant activitypub dataclass
This commit is contained in:
parent
e707374888
commit
fb98ef4b38
4 changed files with 4 additions and 10 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in a new issue