aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/views/admin.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-15 21:18:19 +0100
committerDennis Fink2026-11-15 21:18:19 +0100
commit9b00526ab79257b65cedd71595848f09ecf84279 (patch)
treef9dfc5c0934499d47499bf083bd864f72947958c /webmentions_ssg/views/admin.py
parent509d93b2976e353d29441a7a7b7e78ca466dc4fd (diff)
downloadwebmentions-ssg-9b00526ab79257b65cedd71595848f09ecf84279.tar.gz
webmentions-ssg-9b00526ab79257b65cedd71595848f09ecf84279.zip
refactor(core)!: clarify Webmention domain terminology
Rename ambiguous models, statuses, task modules, fields, and helpers so names reflect source documents, verification, endpoint discovery, and delivery state. Migrate persisted status values and database identifiers without losing existing Webmention data. BREAKING CHANGE: persisted status values and database schema names have changed, and several public Python names have been renamed.
Diffstat (limited to 'webmentions_ssg/views/admin.py')
-rw-r--r--webmentions_ssg/views/admin.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/webmentions_ssg/views/admin.py b/webmentions_ssg/views/admin.py
index 9b7c418..23abe65 100644
--- a/webmentions_ssg/views/admin.py
+++ b/webmentions_ssg/views/admin.py
@@ -15,10 +15,10 @@ from sqlalchemy.orm import selectinload
from .. import forms
from ..extensions import db
-from ..models import ReceivedWebmention, SentWebmention, Source
-from ..tasks.receiver import verify_webmention
+from ..models import ReceivedWebmention, SentWebmention, SourceDocument
from ..tasks.scanner import manual_scan_sources
from ..tasks.sender import send_webmention
+from ..tasks.verification import verify_webmention
from .blueprint import webmentions_bp
@@ -80,7 +80,7 @@ def reverify_received_webmention(webmention_uuid: uuid.UUID) -> ResponseReturnVa
webmention = db.get_or_404(ReceivedWebmention, webmention_uuid)
- webmention.reset_for_verification()
+ webmention.reopen_verification()
db.session.commit()
@@ -101,9 +101,9 @@ def source_list() -> ResponseReturnValue:
:returns: Rendered page containing the paginated source list.
"""
sources = db.paginate(
- sa.select(Source)
- .options(selectinload(Source.sent_webmentions))
- .order_by(Source.last_seen_at.desc()),
+ sa.select(SourceDocument)
+ .options(selectinload(SourceDocument.sent_webmentions))
+ .order_by(SourceDocument.last_seen_at.desc()),
per_page=25,
)
return render_template(
@@ -138,11 +138,11 @@ def source_detail(source_uuid: uuid.UUID) -> ResponseReturnValue:
:param source_uuid: UUID of the source to display.
:returns: Rendered source details page.
"""
- source = db.get_or_404(Source, source_uuid)
+ source = db.get_or_404(SourceDocument, source_uuid)
webmentions = db.paginate(
sa.select(SentWebmention)
- .where(SentWebmention.source_id == source.uuid)
+ .where(SentWebmention.source_uuid == source.uuid)
.order_by(SentWebmention.target, SentWebmention.uuid),
per_page=25,
)
@@ -177,13 +177,13 @@ def resend_webmention(
webmention = db.get_or_404(SentWebmention, webmention_uuid)
- if webmention.source_id != source_uuid:
+ if webmention.source_uuid != source_uuid:
abort(HTTPStatus.NOT_FOUND)
# Requeue the existing desired revision instead of inventing a new source
# revision. send_webmention() otherwise exits when this revision has already
# been processed.
- webmention.resend()
+ webmention.clear_result_for_resend()
db.session.commit()