Cleans up status creation book lookup flow
This commit is contained in:
parent
2c1e7b8ecc
commit
1f2de18d42
5 changed files with 99 additions and 108 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue