Merge pull request #1339 from bookwyrm-social/privacy

Fixes parsing privacy fields from federated posts
This commit is contained in:
Mouse Reeve
2021-08-29 10:52:36 -07:00
committed by GitHub
7 changed files with 103 additions and 16 deletions

View File

@ -275,6 +275,8 @@ def resolve_remote_id(
):
"""take a remote_id and return an instance, creating if necessary"""
if model: # a bonus check we can do if we already know the model
if isinstance(model, str):
model = apps.get_model(f"bookwyrm.{model}", require_ready=True)
result = model.find_existing_by_remote_id(remote_id)
if result and not refresh:
return result if not get_activity else result.to_activity_dataclass()