mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-04 15:26:48 +00:00
Return activities for existing objs in resolve_remote_id
This commit is contained in:
parent
9dbd1c674c
commit
4b44ce691e
2 changed files with 3 additions and 3 deletions
2
.github/workflows/django-tests.yml
vendored
2
.github/workflows/django-tests.yml
vendored
|
@ -65,4 +65,4 @@ jobs:
|
|||
EMAIL_HOST_PASSWORD: ""
|
||||
EMAIL_USE_TLS: true
|
||||
run: |
|
||||
python manage.py test -v 3
|
||||
python manage.py test
|
||||
|
|
|
@ -253,7 +253,7 @@ def resolve_remote_id(remote_id, model=None, refresh=False, save=True):
|
|||
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:
|
||||
|
@ -269,7 +269,7 @@ def resolve_remote_id(remote_id, model=None, refresh=False, save=True):
|
|||
# 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 we're refreshing, "result" will be set and we'll update it
|
||||
|
|
Loading…
Reference in a new issue