1
0
Fork 0

Fixes list item fields and broadcast updates

This commit is contained in:
Mouse Reeve 2021-04-08 14:47:38 -07:00
parent af58455ae9
commit e550f8cde6
3 changed files with 11 additions and 12 deletions

View file

@ -32,7 +32,6 @@ class Shelf(OrderedCollectionMixin, BookWyrmModel):
)
activity_serializer = activitypub.Shelf
collection_field = "shelf"
def save(self, *args, **kwargs):
""" set the identifier """
@ -67,16 +66,17 @@ class ShelfBook(CollectionItemMixin, BookWyrmModel):
""" many to many join table for books and shelves """
book = fields.ForeignKey(
"Edition", on_delete=models.PROTECT, activitypub_field="object"
"Edition", on_delete=models.PROTECT, activitypub_field="book"
)
shelf = fields.ForeignKey(
"Shelf", on_delete=models.PROTECT, activitypub_field="target"
shelf = models.ForeignKey(
"Shelf", on_delete=models.PROTECT
)
user = fields.ForeignKey(
"User", on_delete=models.PROTECT, activitypub_field="actor"
)
activity_serializer = activitypub.ShelfItem
collection_field = "shelf"
def save(self, *args, **kwargs):
if not self.user: