aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/views/endpoint.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/views/endpoint.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/webmentions_ssg/views/endpoint.py b/webmentions_ssg/views/endpoint.py
index 6d84d92..322e0f0 100644
--- a/webmentions_ssg/views/endpoint.py
+++ b/webmentions_ssg/views/endpoint.py
@@ -14,11 +14,12 @@ import sqlalchemy.exc as sa_exc
from flask import Response, current_app, render_template, url_for
from flask.typing import ResponseReturnValue
-from .. import forms
from ..db_helpers import rows_affected
from ..extensions import csrf, db, limiter
-from ..models import ReceivedWebmention, source_target_digest
-from ..source_policy import source_rejection_reason
+from ..forms.endpoint import WebmentionSubmissionForm
+from ..models.received import ReceivedWebmention
+from ..models.utils import source_target_digest
+from ..moderation_policy import rejection_reason
from ..tasks.verification import verify_webmention
from .blueprint import webmentions_bp
@@ -145,7 +146,7 @@ def receive_webmention() -> ResponseReturnValue:
:returns: HTTP 201 response with the Webmention status URL in the ``Location``
header, or validation errors with HTTP 400.
"""
- form = forms.WebmentionSubmissionForm(meta={"csrf": False})
+ form = WebmentionSubmissionForm(meta={"csrf": False})
if not form.validate_on_submit():
return form.errors, HTTPStatus.BAD_REQUEST
@@ -153,7 +154,7 @@ def receive_webmention() -> ResponseReturnValue:
source = cast(str, form.source.data)
target = cast(str, form.target.data)
- if reason := source_rejection_reason(source):
+ if reason := rejection_reason(source):
return {"error": reason}, HTTPStatus.FORBIDDEN
result = record_submission(source, target)