diff --git a/users/models/identity.py b/users/models/identity.py index 575dee0..9f19305 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -771,7 +771,7 @@ class Identity(StatorModel): if not isinstance(item, dict): continue post_obj: dict | None = item - if item["type"] == "Create": + if item["type"] in ["Create", "Update"]: post_obj = item.get("object") if post_obj: ids.append(post_obj["id"]) diff --git a/users/services/identity.py b/users/services/identity.py index 2b3427b..71b0a4f 100644 --- a/users/services/identity.py +++ b/users/services/identity.py @@ -190,13 +190,17 @@ class IdentityService: with transaction.atomic(): for object_uri in object_uris: - post = Post.by_object_uri(object_uri, fetch=True) - PostInteraction.objects.get_or_create( - type=PostInteraction.Types.pin, - identity=self.identity, - post=post, - state__in=PostInteractionStates.group_active(), - ) + try: + post = Post.by_object_uri(object_uri, fetch=True) + PostInteraction.objects.get_or_create( + type=PostInteraction.Types.pin, + identity=self.identity, + post=post, + state__in=PostInteractionStates.group_active(), + ) + except Post.DoesNotExist: + # ignore 404s... + pass for removed in PostInteraction.objects.filter( type=PostInteraction.Types.pin, identity=self.identity,