diff options
| author | Dennis Fink | 2026-08-17 20:06:22 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-08-17 20:06:22 +0200 |
| commit | d4a03623544aac0ce911d8471ff4b033bc3255e1 (patch) | |
| tree | 0d707db5a9aed7442c28e0ac0de8898aab54c090 /webmentions_ssg/views.py | |
| parent | 85a73c811a3de333138978d8d450533caa668dc5 (diff) | |
| download | webmentions-ssg-d4a03623544aac0ce911d8471ff4b033bc3255e1.tar.gz webmentions-ssg-d4a03623544aac0ce911d8471ff4b033bc3255e1.zip | |
feat(sender): add manual source rescan action
Add an authenticated action to queue a source rescan from the sent
Webmentions overview.
Extract the reusable confirmation modal and its JavaScript so received
and sent admin actions share the same implementation.
Diffstat (limited to 'webmentions_ssg/views.py')
| -rw-r--r-- | webmentions_ssg/views.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/webmentions_ssg/views.py b/webmentions_ssg/views.py index eeea765..13e5086 100644 --- a/webmentions_ssg/views.py +++ b/webmentions_ssg/views.py @@ -22,6 +22,7 @@ from . import CSRF, forms from . import DATABASE as db from .models import ReceivedWebmention, Source, User from .tasks.receiver import verify_webmention +from .tasks.scanner import manual_scan_sources root_page = Blueprint("root", __name__) @@ -138,7 +139,22 @@ def sent() -> ResponseReturnValue: .order_by(Source.last_seen_at.desc()), per_page=25, ) - return render_template("sent.html", title="Sent Webmentions", sources=sources) + return render_template( + "sent.html", + title="Sent Webmentions", + sources=sources, + action_form=forms.AdminActionForm(), + ) + + +@root_page.post("/sent/rescan") +@login_required +def rescan_sent_sources(): + form = forms.AdminActionForm() + if form.validate_on_submit(): + manual_scan_sources() + flash("Source rescan queued.", "success") + return redirect(url_for("root.sent")) @root_page.route("/sent/<uuid:identifier>") |
