diff options
| author | Dennis Fink | 2026-10-27 23:49:24 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-27 23:49:24 +0100 |
| commit | c6a40d741c41cdc0af38eef89247c2120dcb6270 (patch) | |
| tree | 414df73642a42f4e24b3a0b4bb2bf914d678583d /webmentions_ssg/cli | |
| parent | 17ab56a3c7d3dbb3d66edf380ab637a61cefe50c (diff) | |
| download | webmentions-ssg-c6a40d741c41cdc0af38eef89247c2120dcb6270.tar.gz webmentions-ssg-c6a40d741c41cdc0af38eef89247c2120dcb6270.zip | |
fix(core): resolve static type checking issues
Diffstat (limited to 'webmentions_ssg/cli')
| -rw-r--r-- | webmentions_ssg/cli/__init__.py | 2 | ||||
| -rw-r--r-- | webmentions_ssg/cli/mail.py | 2 | ||||
| -rw-r--r-- | webmentions_ssg/cli/users.py | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/webmentions_ssg/cli/__init__.py b/webmentions_ssg/cli/__init__.py index 25d78d5..accaaa3 100644 --- a/webmentions_ssg/cli/__init__.py +++ b/webmentions_ssg/cli/__init__.py @@ -1,3 +1,5 @@ # SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me> # # SPDX-License-Identifier: BSD-3-Clause + +"""Group the application command-line management modules.""" diff --git a/webmentions_ssg/cli/mail.py b/webmentions_ssg/cli/mail.py index 3ea903e..47687e2 100644 --- a/webmentions_ssg/cli/mail.py +++ b/webmentions_ssg/cli/mail.py @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: BSD-3-Clause +"""Provide a command for testing outgoing email configuration.""" + import click from flask import current_app from flask.cli import AppGroup diff --git a/webmentions_ssg/cli/users.py b/webmentions_ssg/cli/users.py index 4ece2f4..7c6afde 100644 --- a/webmentions_ssg/cli/users.py +++ b/webmentions_ssg/cli/users.py @@ -2,9 +2,12 @@ # # SPDX-License-Identifier: BSD-3-Clause +"""Provide commands for managing application user accounts.""" + import click import sqlalchemy as sa from flask.cli import AppGroup +from sqlalchemy.exc import IntegrityError from .. import DATABASE @@ -47,7 +50,7 @@ def create_user(username: str, password: str) -> None: DATABASE.session.add(User(username=username, password=password)) try: DATABASE.session.commit() - except sa.exc.IntegrityError as exc: + except IntegrityError as exc: DATABASE.session.rollback() raise click.ClickException(f"User {username!r} already exists.") from exc |
