From 1a50509465a043e35659ba5cb1be9ebdbab234ff Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:40:03 +1300 Subject: [PATCH] improve compatibility with python 3.11 refs #36 --- app/activitypub/util.py | 2 +- app/templates/admin/activities.html | 2 +- app/templates/admin/communities.html | 2 +- app/templates/admin/reports.html | 2 +- app/templates/admin/users.html | 2 +- app/templates/community/community.html | 4 ++-- app/templates/domain/domain.html | 2 +- app/templates/index.html | 2 +- app/templates/topic/show_topic.html | 4 ++-- app/templates/user/show_profile.html | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 1ba0c9aa..3563f25d 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -130,7 +130,7 @@ def post_to_activity(post: Post, community: Community): "mediaType": "text/markdown" }, "attachment": [], - "commentsEnabled": True, + "commentsEnabled": post.comments_enabled, "sensitive": post.nsfw or post.nsfl, "published": ap_datetime(post.created_at), "audience": f"https://{current_app.config['SERVER_NAME']}/c/{community.name}" diff --git a/app/templates/admin/activities.html b/app/templates/admin/activities.html index c848f3f9..8f1c1372 100644 --- a/app/templates/admin/activities.html +++ b/app/templates/admin/activities.html @@ -20,7 +20,7 @@ Message JSON - {% for activity in activities %} + {% for activity in activities.items %} {{ moment(activity.created_at).fromNow() }} {{ activity.direction }} diff --git a/app/templates/admin/communities.html b/app/templates/admin/communities.html index b61e1637..411659f2 100644 --- a/app/templates/admin/communities.html +++ b/app/templates/admin/communities.html @@ -24,7 +24,7 @@ All Actions - {% for community in communities %} + {% for community in communities.items %} {{ community.name }} diff --git a/app/templates/admin/reports.html b/app/templates/admin/reports.html index 23d45cfe..97827f29 100644 --- a/app/templates/admin/reports.html +++ b/app/templates/admin/reports.html @@ -25,7 +25,7 @@ Created Actions - {% for report in reports %} + {% for report in reports.items %} {{ 'Local' if report.is_local() else 'Remote' }} {{ report.reasons }} diff --git a/app/templates/admin/users.html b/app/templates/admin/users.html index f2a52d34..881816f7 100644 --- a/app/templates/admin/users.html +++ b/app/templates/admin/users.html @@ -28,7 +28,7 @@ IP Actions - {% for user in users %} + {% for user in users.items %} {{ user.display_name() }} diff --git a/app/templates/community/community.html b/app/templates/community/community.html index a0c1ea72..5b623ec1 100644 --- a/app/templates/community/community.html +++ b/app/templates/community/community.html @@ -66,7 +66,7 @@ {% include "community/_community_nav.html" %} {% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser_masonry.html' %} {% else %}

{{ _('No posts in this community yet.') }}

@@ -74,7 +74,7 @@
{% else %}
- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser.html' %} {% else %}

{{ _('No posts in this community yet.') }}

diff --git a/app/templates/domain/domain.html b/app/templates/domain/domain.html index b058ebc0..aced33eb 100644 --- a/app/templates/domain/domain.html +++ b/app/templates/domain/domain.html @@ -13,7 +13,7 @@

{{ domain.name }}

- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser.html' %} {% else %}

{{ _('No posts in this domain yet.') }}

diff --git a/app/templates/index.html b/app/templates/index.html index b1b6019a..d4d861ea 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -6,7 +6,7 @@
{% include "_home_nav.html" %}
- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser.html' %} {% else %}

{{ _('No posts yet. Join some communities to see more.') }}

diff --git a/app/templates/topic/show_topic.html b/app/templates/topic/show_topic.html index e5e033cc..52e3db7e 100644 --- a/app/templates/topic/show_topic.html +++ b/app/templates/topic/show_topic.html @@ -17,7 +17,7 @@ {% include "community/_community_nav.html" %} {% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser_masonry.html' %} {% else %}

{{ _('No posts in this topic yet.') }}

@@ -25,7 +25,7 @@
{% else %}
- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser.html' %} {% else %}

{{ _('No posts in this topic yet.') }}

diff --git a/app/templates/user/show_profile.html b/app/templates/user/show_profile.html index f4ffb14a..e2a0be64 100644 --- a/app/templates/user/show_profile.html +++ b/app/templates/user/show_profile.html @@ -56,7 +56,7 @@ {% if posts %}

Posts

- {% for post in posts %} + {% for post in posts.items %} {% include 'post/_post_teaser.html' %} {% endfor %}
@@ -79,7 +79,7 @@ {% if post_replies %}

Comments

- {% for post_reply in post_replies %} + {% for post_reply in post_replies.items %} {% include 'post/_post_reply_teaser.html' %} {% endfor %}