diff --git a/journal/templatetags/user_actions.py b/journal/templatetags/user_actions.py index 67582c77..d5590a52 100644 --- a/journal/templatetags/user_actions.py +++ b/journal/templatetags/user_actions.py @@ -30,7 +30,7 @@ def liked_post(context, post): return ( user and user.is_authenticated - and Takahe.post_liked_by(post.pk, user.identity.pk) + and post.interactions.filter(identity_id=user.identity.pk, type="like").exists() ) @@ -40,5 +40,7 @@ def boosted_post(context, post): return ( user and user.is_authenticated - and Takahe.post_boosted_by(post.pk, user.identity.pk) + and post.interactions.filter( + identity_id=user.identity.pk, type="boost" + ).exists() ) diff --git a/neodb-takahe b/neodb-takahe index cb53b38b..9b57e4f2 160000 --- a/neodb-takahe +++ b/neodb-takahe @@ -1 +1 @@ -Subproject commit cb53b38b3e8de79233867de3e89459ce820c1e58 +Subproject commit 9b57e4f24413b1b335987ca8575e08b400e7fb41 diff --git a/social/templates/feed_events.html b/social/templates/feed_events.html index c79b848d..2591b5c4 100644 --- a/social/templates/feed_events.html +++ b/social/templates/feed_events.html @@ -8,7 +8,7 @@ {% load user_actions %} {% load duration %} {% for event in events %} - {% with event.subject_post as post %} + {% with post=event.subject_post piece=event.subject_post.piece item=event.subject_post.piece.item %} {% if not post %} {% else %} @@ -34,22 +34,22 @@
{% if post.piece %} - {% if post.piece.item %} - {#{% include "_item_card.html" with item=post.piece.item allow_embed=1 %} #} - -+ {% if item %} + {#
{% include "_item_card.html" with item=item allow_embed=1 %} #} + +{% endif %} {% endif %} diff --git a/social/views.py b/social/views.py index 03bdeea6..92d2d584 100644 --- a/social/views.py +++ b/social/views.py @@ -68,17 +68,17 @@ def data(request): .select_related( "subject_post", "subject_post__author", - "subject_post__author__domain", + # "subject_post__author__domain", "subject_identity", - "subject_identity__domain", + # "subject_identity__domain", "subject_post_interaction", "subject_post_interaction__identity", - "subject_post_interaction__identity__domain", + # "subject_post_interaction__identity__domain", ) .prefetch_related( "subject_post__attachments", - "subject_post__mentions", - "subject_post__emojis", + # "subject_post__mentions", + # "subject_post__emojis", ) ) if since_id: