Cleans up status creation book lookup flow
This commit is contained in:
@@ -7,7 +7,7 @@ from django.http import HttpResponseNotFound, JsonResponse
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
import requests
|
||||
|
||||
from fedireads import activitypub
|
||||
from fedireads import activitypub, books_manager
|
||||
from fedireads import models
|
||||
from fedireads.broadcast import broadcast
|
||||
from fedireads.status import create_review, create_status
|
||||
@@ -260,9 +260,10 @@ def handle_comment(user, book, content):
|
||||
user, book, builder, fr_serializer, ap_serializer, content)
|
||||
|
||||
|
||||
def handle_status(user, book, \
|
||||
def handle_status(user, book_id, \
|
||||
builder, fr_serializer, ap_serializer, *args):
|
||||
''' generic handler for statuses '''
|
||||
book = books_manager.get_or_create_book(book_id)
|
||||
status = builder(user, book, *args)
|
||||
|
||||
activity = fr_serializer(status)
|
||||
|
Reference in New Issue
Block a user