mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-22 16:16:39 +00:00
Format reviews in outbox
This commit is contained in:
parent
ff25152afe
commit
400ddaa5fd
2 changed files with 7 additions and 3 deletions
|
@ -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 + '?' + \
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue