aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/cli/users.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/cli/users.py5
1 files changed, 4 insertions, 1 deletions
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