diff options
| author | Dennis Fink | 2026-08-20 23:01:59 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-08-20 23:01:59 +0200 |
| commit | 5bfcc3c06ebe6d6694221c25f07a4901572f97f5 (patch) | |
| tree | fd3e9e0c8dfbde16bf96095809a765491c6d0c98 /webmentions_ssg/forms/__init__.py | |
| parent | 12b8c4b7f1d14556cc459f672b501e901da2d216 (diff) | |
| download | webmentions-ssg-5bfcc3c06ebe6d6694221c25f07a4901572f97f5.tar.gz webmentions-ssg-5bfcc3c06ebe6d6694221c25f07a4901572f97f5.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/forms/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
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") |
