From 5bfcc3c06ebe6d6694221c25f07a4901572f97f5 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 20 Aug 2026 23:01:59 +0200 Subject: docs(core): add docstrings and type annotations Document forms, validators, models, and views with PEP 287-style docstrings and complete missing type annotations. Add developer-readable representations for Webmention models and mark the user password property as write-only in its return type. --- webmentions_ssg/forms/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'webmentions_ssg/forms/__init__.py') diff --git a/webmentions_ssg/forms/__init__.py b/webmentions_ssg/forms/__init__.py index 7ab82e3..5d2f827 100644 --- a/webmentions_ssg/forms/__init__.py +++ b/webmentions_ssg/forms/__init__.py @@ -12,12 +12,23 @@ from .validators import AllowedHostname, NotEqualTo, PublicURL class LoginForm(FlaskForm): + """ + Form for authenticating a user. + """ + username = StringField("Username", validators=[InputRequired()]) password = PasswordField("Password", validators=[InputRequired()]) submit = SubmitField("Sign In") class EndpointForm(FlaskForm): + """ + Form for receiving a Webmention. + + The source must be a public HTTP or HTTPS URL distinct from the target. + The target must be an HTTP or HTTPS URL using an allowed hostname. + """ + source = StringField( "source", validators=[ @@ -48,4 +59,8 @@ class EndpointForm(FlaskForm): class AdminActionForm(FlaskForm): + """ + Form for confirming an administrative action. + """ + submit = SubmitField("Confirm") -- cgit v1.3.1