improve compatibility with python 3.11 refs #36

This commit is contained in:
rimu 2024-02-06 17:40:03 +13:00
parent c51c735038
commit 1a50509465
10 changed files with 13 additions and 13 deletions

View file

@ -130,7 +130,7 @@ def post_to_activity(post: Post, community: Community):
"mediaType": "text/markdown" "mediaType": "text/markdown"
}, },
"attachment": [], "attachment": [],
"commentsEnabled": True, "commentsEnabled": post.comments_enabled,
"sensitive": post.nsfw or post.nsfl, "sensitive": post.nsfw or post.nsfl,
"published": ap_datetime(post.created_at), "published": ap_datetime(post.created_at),
"audience": f"https://{current_app.config['SERVER_NAME']}/c/{community.name}" "audience": f"https://{current_app.config['SERVER_NAME']}/c/{community.name}"

View file

@ -20,7 +20,7 @@
<th>Message</th> <th>Message</th>
<th>JSON</th> <th>JSON</th>
</tr> </tr>
{% for activity in activities %} {% for activity in activities.items %}
<tr> <tr>
<td>{{ moment(activity.created_at).fromNow() }}</td> <td>{{ moment(activity.created_at).fromNow() }}</td>
<td>{{ activity.direction }}</td> <td>{{ activity.direction }}</td>

View file

@ -24,7 +24,7 @@
<th>All</th> <th>All</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
{% for community in communities %} {% for community in communities.items %}
<tr> <tr>
<td>{{ community.name }}</td> <td>{{ community.name }}</td>
<td><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" /> <td><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" />

View file

@ -25,7 +25,7 @@
<th>Created</th> <th>Created</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
{% for report in reports %} {% for report in reports.items %}
<tr> <tr>
<td>{{ 'Local' if report.is_local() else 'Remote' }}</td> <td>{{ 'Local' if report.is_local() else 'Remote' }}</td>
<td>{{ report.reasons }}</td> <td>{{ report.reasons }}</td>

View file

@ -28,7 +28,7 @@
<th>IP</th> <th>IP</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
{% for user in users %} {% for user in users.items %}
<tr> <tr>
<td><img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" /> <td><img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
{{ user.display_name() }}</td> {{ user.display_name() }}</td>

View file

@ -66,7 +66,7 @@
{% include "community/_community_nav.html" %} {% include "community/_community_nav.html" %}
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %} {% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
<div class="post_list_{{ post_layout }}"> <div class="post_list_{{ post_layout }}">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser_masonry.html' %} {% include 'post/_post_teaser_masonry.html' %}
{% else %} {% else %}
<p>{{ _('No posts in this community yet.') }}</p> <p>{{ _('No posts in this community yet.') }}</p>
@ -74,7 +74,7 @@
</div> </div>
{% else %} {% else %}
<div class="post_list"> <div class="post_list">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser.html' %} {% include 'post/_post_teaser.html' %}
{% else %} {% else %}
<p>{{ _('No posts in this community yet.') }}</p> <p>{{ _('No posts in this community yet.') }}</p>

View file

@ -13,7 +13,7 @@
</nav> </nav>
<h1 class="mt-2">{{ domain.name }}</h1> <h1 class="mt-2">{{ domain.name }}</h1>
<div class="post_list"> <div class="post_list">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser.html' %} {% include 'post/_post_teaser.html' %}
{% else %} {% else %}
<p>{{ _('No posts in this domain yet.') }}</p> <p>{{ _('No posts in this domain yet.') }}</p>

View file

@ -6,7 +6,7 @@
<div class="col-12 col-md-8 position-relative main_pane"> <div class="col-12 col-md-8 position-relative main_pane">
{% include "_home_nav.html" %} {% include "_home_nav.html" %}
<div class="post_list"> <div class="post_list">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser.html' %} {% include 'post/_post_teaser.html' %}
{% else %} {% else %}
<p>{{ _('No posts yet. Join some communities to see more.') }}</p> <p>{{ _('No posts yet. Join some communities to see more.') }}</p>

View file

@ -17,7 +17,7 @@
{% include "community/_community_nav.html" %} {% include "community/_community_nav.html" %}
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %} {% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
<div class="post_list_{{ post_layout }}"> <div class="post_list_{{ post_layout }}">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser_masonry.html' %} {% include 'post/_post_teaser_masonry.html' %}
{% else %} {% else %}
<p>{{ _('No posts in this topic yet.') }}</p> <p>{{ _('No posts in this topic yet.') }}</p>
@ -25,7 +25,7 @@
</div> </div>
{% else %} {% else %}
<div class="post_list"> <div class="post_list">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser.html' %} {% include 'post/_post_teaser.html' %}
{% else %} {% else %}
<p>{{ _('No posts in this topic yet.') }}</p> <p>{{ _('No posts in this topic yet.') }}</p>

View file

@ -56,7 +56,7 @@
{% if posts %} {% if posts %}
<h2 class="mt-4">Posts</h2> <h2 class="mt-4">Posts</h2>
<div class="post_list"> <div class="post_list">
{% for post in posts %} {% for post in posts.items %}
{% include 'post/_post_teaser.html' %} {% include 'post/_post_teaser.html' %}
{% endfor %} {% endfor %}
</div> </div>
@ -79,7 +79,7 @@
{% if post_replies %} {% if post_replies %}
<h2 class="mt-4" id="comments">Comments</h2> <h2 class="mt-4" id="comments">Comments</h2>
<div class="post_list"> <div class="post_list">
{% for post_reply in post_replies %} {% for post_reply in post_replies.items %}
{% include 'post/_post_reply_teaser.html' %} {% include 'post/_post_reply_teaser.html' %}
{% endfor %} {% endfor %}
</div> </div>