Removes outgoing and view_actions

This commit is contained in:
Mouse Reeve
2021-01-13 13:36:01 -08:00
parent a385aa4cb5
commit 3e5ed19643
8 changed files with 199 additions and 169 deletions

22
bookwyrm/views/outbox.py Normal file
View File

@ -0,0 +1,22 @@
''' the good stuff! the books! '''
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.views import View
from bookwyrm import activitypub, models
# pylint: disable= no-self-use
class Outbox(View):
''' outbox '''
def get(self, request, username):
''' outbox for the requested user '''
user = get_object_or_404(models.User, localname=username)
filter_type = request.GET.get('type')
if filter_type not in models.status_models:
filter_type = None
return JsonResponse(
user.to_outbox(**request.GET, filter_type=filter_type),
encoder=activitypub.ActivityEncoder
)