diff options
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/views.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/webmentions_ssg/views.py b/webmentions_ssg/views.py index 2235735..543a44c 100644 --- a/webmentions_ssg/views.py +++ b/webmentions_ssg/views.py @@ -220,16 +220,19 @@ def sent_source(source_identifier: uuid.UUID) -> ResponseReturnValue: :return: Rendered source details page. """ source = db.session.scalar( - sa.select(Source) - .options(selectinload(Source.sent_webmentions)) - .where(Source.uuid == source_identifier) + sa.select(Source).where(Source.uuid == source_identifier) ) + if source is None: return abort(404) - webmentions = sorted( - source.sent_webmentions, key=lambda webmention: webmention.target + webmentions = db.paginate( + sa.select(SentWebmention) + .where(SentWebmention.source_id == source.uuid) + .order_by(SentWebmention.target, SentWebmention.uuid), + per_page=25, ) + return render_template( "sent_source.html", title="Sent Webmentions", |
