mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Deduplicate incoming Create notes
This commit is contained in:
parent
722f44ac9f
commit
21c0a0163a
2 changed files with 5 additions and 1 deletions
|
@ -217,6 +217,10 @@ def handle_create(activity):
|
|||
return
|
||||
|
||||
# render the json into an activity object
|
||||
status_id = activity['object']['id']
|
||||
if models.Status.objects.filter(remote_id=status_id).count():
|
||||
return
|
||||
|
||||
serializer = activitypub.activity_objects[activity['object']['type']]
|
||||
activity = serializer(**activity['object'])
|
||||
|
||||
|
|
|
@ -76,8 +76,8 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
|||
return tags
|
||||
|
||||
shared_mappings = [
|
||||
ActivityMapping('id', 'remote_id'),
|
||||
ActivityMapping('url', 'remote_id'),
|
||||
ActivityMapping('id', 'remote_id'),
|
||||
ActivityMapping('inReplyTo', 'reply_parent'),
|
||||
ActivityMapping('published', 'published_date'),
|
||||
ActivityMapping('attributedTo', 'user'),
|
||||
|
|
Loading…
Reference in a new issue