From 63af533d98aac82b6d4f069b217d3e837285508d Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 17 Nov 2026 22:10:40 +0100 Subject: feat(receiver): explain received Webmention failures Map known verification failures to human-readable explanations and show suggested next steps only for receiver-controlled problems while retaining raw reasons. Return a specific validation error when targets are outside `ALLOWED_TARGET_HOSTNAMES` and reuse the guidance for status history. --- webmentions_ssg/forms/validators.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'webmentions_ssg/forms/validators.py') diff --git a/webmentions_ssg/forms/validators.py b/webmentions_ssg/forms/validators.py index e65e9cb..a22c942 100644 --- a/webmentions_ssg/forms/validators.py +++ b/webmentions_ssg/forms/validators.py @@ -102,7 +102,14 @@ class AllowedTargetHostname: if hostname in current_app.config["ALLOWED_TARGET_HOSTNAMES"]: return - raise ValidationError(self.message or field.gettext("Invalid input.")) + raise ValidationError( + self.message + or field.gettext( + "Target hostname is not in ALLOWED_TARGET_HOSTNAMES." + if hostname is not None + else "Invalid input." + ) + ) class RejectNonPublicIPLiteral: -- cgit v1.3.1