diff options
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/views/admin.py | 20 |
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() |
