forked from mirrors/bookwyrm
Deduplicate incoming create activities
This is a regression.
This commit is contained in:
parent
ba97870276
commit
83770abfd2
2 changed files with 5 additions and 2 deletions
|
@ -32,7 +32,6 @@ def inbox(request, username):
|
|||
@csrf_exempt
|
||||
def shared_inbox(request):
|
||||
''' incoming activitypub events '''
|
||||
# TODO: should this be functionally different from the non-shared inbox??
|
||||
if request.method == 'GET':
|
||||
return HttpResponseNotFound()
|
||||
|
||||
|
@ -217,6 +216,11 @@ def handle_create(activity):
|
|||
# we really oughtn't even be sending in this case
|
||||
return
|
||||
|
||||
# deduplicate incoming activities
|
||||
status_id = activity['object']['id']
|
||||
if models.Status.objects.filter(remote_id=status_id).count():
|
||||
return
|
||||
|
||||
status = status_builder.create_status(activity['object'])
|
||||
|
||||
# create a notification if this is a reply
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
from datetime import datetime
|
||||
|
||||
from bookwyrm import activitypub, books_manager, models
|
||||
from bookwyrm.books_manager import get_or_create_book
|
||||
from bookwyrm.sanitize_html import InputHtmlParser
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue