Fixes incoming tagging

This commit is contained in:
Mouse Reeve 2020-02-20 22:37:50 -08:00
parent 3fdb57e26a
commit bc4e65ae81

View file

@ -12,7 +12,6 @@ import requests
from fedireads import activitypub from fedireads import activitypub
from fedireads import models from fedireads import models
from fedireads import outgoing from fedireads import outgoing
from fedireads.openlibrary import get_or_create_book
from fedireads.status import create_review, create_status, create_tag from fedireads.status import create_review, create_status, create_tag
from fedireads.remote_user import get_or_create_remote_user from fedireads.remote_user import get_or_create_remote_user
@ -283,8 +282,7 @@ def handle_incoming_add(activity):
if activity['object']['type'] == 'Tag': if activity['object']['type'] == 'Tag':
user = get_or_create_remote_user(activity['actor']) user = get_or_create_remote_user(activity['actor'])
if not user.local: if not user.local:
book_id = activity['target']['id'].split('/')[-1] book = activity['target']['id'].split('/')[-1]
book = get_or_create_book(book_id)
create_tag(user, book, activity['object']['name']) create_tag(user, book, activity['object']['name'])
return HttpResponse() return HttpResponse()
return HttpResponse() return HttpResponse()