diff --git a/bookwyrm/models/activitypub_mixin.py b/bookwyrm/models/activitypub_mixin.py index eee916bb..4efb08d7 100644 --- a/bookwyrm/models/activitypub_mixin.py +++ b/bookwyrm/models/activitypub_mixin.py @@ -446,9 +446,8 @@ class CollectionItemMixin(ActivitypubMixin): ).serialize() -class ActivitybMixin(ActivitypubMixin): +class ActivityMixin(ActivitypubMixin): ''' add this mixin for models that are AP serializable ''' - def save(self, *args, **kwargs): ''' broadcast activity ''' super().save(*args, **kwargs) diff --git a/bookwyrm/models/favorite.py b/bookwyrm/models/favorite.py index 9809efe7..4c66bfd5 100644 --- a/bookwyrm/models/favorite.py +++ b/bookwyrm/models/favorite.py @@ -3,11 +3,11 @@ from django.db import models from django.utils import timezone from bookwyrm import activitypub -from .activitypub_mixin import ActivitypubMixin +from .activitypub_mixin import ActivityMixin from .base_model import BookWyrmModel from . import fields -class Favorite(ActivitypubMixin, BookWyrmModel): +class Favorite(ActivityMixin, BookWyrmModel): ''' fav'ing a post ''' user = fields.ForeignKey( 'User', on_delete=models.PROTECT, activitypub_field='actor') diff --git a/bookwyrm/models/relationship.py b/bookwyrm/models/relationship.py index 44af41ff..712f607b 100644 --- a/bookwyrm/models/relationship.py +++ b/bookwyrm/models/relationship.py @@ -4,12 +4,12 @@ from django.db.models import Q from django.dispatch import receiver from bookwyrm import activitypub -from .activitypub_mixin import ActivitypubMixin +from .activitypub_mixin import ActivityMixin from .base_model import BookWyrmModel from . import fields -class UserRelationship(ActivitypubMixin, BookWyrmModel): +class UserRelationship(ActivityMixin, BookWyrmModel): ''' many-to-many through table for followers ''' user_subject = fields.ForeignKey( 'User', diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index dc170f3c..74ede26c 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -9,10 +9,11 @@ from django.utils import timezone from model_utils.managers import InheritanceManager from bookwyrm import activitypub -from .activitypub_mixin import ActivitypubMixin, OrderedCollectionPageMixin +from .activitypub_mixin import ActivitypubMixin, ActivityMixin +from .activitypub_mixin import OrderedCollectionPageMixin from .base_model import BookWyrmModel -from . import fields from .fields import image_serializer +from . import fields class Status(OrderedCollectionPageMixin, BookWyrmModel): ''' any post, like a reply to a review, etc ''' @@ -223,7 +224,7 @@ class Review(Status): pure_type = 'Article' -class Boost(Status): +class Boost(ActivityMixin, Status): ''' boost'ing a post ''' boosted_status = fields.ForeignKey( 'Status',