diff --git a/fedireads/activitypub/collection.py b/fedireads/activitypub/collection.py index 34ce2318..426553b9 100644 --- a/fedireads/activitypub/collection.py +++ b/fedireads/activitypub/collection.py @@ -2,7 +2,7 @@ from uuid import uuid4 from urllib.parse import urlencode -from .status import get_status +from .status import get_status, get_review def get_outbox(user, size): ''' helper function for creating an outbox ''' @@ -21,7 +21,11 @@ def get_outbox_page(user, page_id, statuses, max_id, min_id): } for status in statuses: - page['orderedItems'].append(get_status(status)) + if status.status_type == 'Review': + status_activity = get_review(status) + else: + status_activity = get_status(status) + page['orderedItems'].append(status_activity) if max_id: page['next'] = user.outbox + '?' + \ diff --git a/fedireads/outgoing.py b/fedireads/outgoing.py index d22c2a92..a87cc6f3 100644 --- a/fedireads/outgoing.py +++ b/fedireads/outgoing.py @@ -40,7 +40,7 @@ def outbox(request, username): statuses = models.Status.objects.filter( user=user, **filters - ).all()[:limit] + ).select_subclasses().all()[:limit] return JsonResponse( activitypub.get_outbox_page(user, page_id, statuses, max_id, min_id)