diff options
Diffstat (limited to 'webmentions_ssg/views/admin.py')
| -rw-r--r-- | webmentions_ssg/views/admin.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/webmentions_ssg/views/admin.py b/webmentions_ssg/views/admin.py index 1025e69..2ccd92a 100644 --- a/webmentions_ssg/views/admin.py +++ b/webmentions_ssg/views/admin.py @@ -5,6 +5,7 @@ """Authenticated incoming and outgoing Webmention management.""" import uuid +from http import HTTPStatus import sqlalchemy as sa from flask import abort, flash, redirect, render_template, request, url_for @@ -50,7 +51,7 @@ def delete_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue: :returns: Redirect response to the received Webmentions view. """ if not forms.AdminActionForm().validate_on_submit(): - abort(400) + abort(HTTPStatus.BAD_REQUEST) webmention = db.get_or_404(ReceivedWebmention, identifier) @@ -75,7 +76,7 @@ def reverify_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue: :returns: Redirect response to the received Webmentions view. """ if not forms.AdminActionForm().validate_on_submit(): - abort(400) + abort(HTTPStatus.BAD_REQUEST) webmention = db.get_or_404(ReceivedWebmention, identifier) @@ -121,7 +122,7 @@ def rescan_sent_sources() -> ResponseReturnValue: :returns: Redirect response to the sent Webmentions view. """ if not forms.AdminActionForm().validate_on_submit(): - abort(400) + abort(HTTPStatus.BAD_REQUEST) manual_scan_sources() flash("Source rescan queued.", "success") @@ -172,12 +173,12 @@ def resend_sent_webmention( :returns: Redirect response to the source details view. """ if not forms.AdminActionForm().validate_on_submit(): - abort(400) + abort(HTTPStatus.BAD_REQUEST) webmention = db.get_or_404(SentWebmention, webmention_identifier) if webmention.source_id != source_identifier: - abort(404) + 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 |
