From d8c83fa31c84553723cc0e43bbac5a77472cf19a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 24 Mar 2021 12:58:39 -0700 Subject: [PATCH] Return activities for existing objs in resolve_remote_id --- .github/workflows/django-tests.yml | 2 +- bookwyrm/activitypub/base_activity.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/django-tests.yml b/.github/workflows/django-tests.yml index e734d18e..3ce368ec 100644 --- a/.github/workflows/django-tests.yml +++ b/.github/workflows/django-tests.yml @@ -65,4 +65,4 @@ jobs: EMAIL_HOST_PASSWORD: "" EMAIL_USE_TLS: true run: | - python manage.py test -v 3 + python manage.py test diff --git a/bookwyrm/activitypub/base_activity.py b/bookwyrm/activitypub/base_activity.py index c1f81bb0..768eb208 100644 --- a/bookwyrm/activitypub/base_activity.py +++ b/bookwyrm/activitypub/base_activity.py @@ -255,7 +255,7 @@ def resolve_remote_id( if model: # a bonus check we can do if we already know the model result = model.find_existing_by_remote_id(remote_id) if result and not refresh: - return result + return result if not get_activity else result.to_activity_dataclass() # load the data and create the object try: @@ -271,7 +271,7 @@ def resolve_remote_id( # check for existing items with shared unique identifiers result = model.find_existing(data) if result and not refresh: - return result + return result if not get_activity else result.to_activity_dataclass() item = model.activity_serializer(**data) if get_activity: