From c6a40d741c41cdc0af38eef89247c2120dcb6270 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 27 Oct 2026 23:49:24 +0100 Subject: fix(core): resolve static type checking issues --- webmentions_ssg/cli/users.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webmentions_ssg/cli/users.py') 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 -- cgit v1.3.1