From 4284de1cd063440696cad67d276deaa326bba039 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 23 Jun 2021 22:08:33 -0700 Subject: [PATCH] Misc touchups --- amanuensis/backend/lexicon.py | 4 +++- amanuensis/cli/lexicon.py | 3 +++ pytest.ini | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/amanuensis/backend/lexicon.py b/amanuensis/backend/lexicon.py index 6df3473..5efd406 100644 --- a/amanuensis/backend/lexicon.py +++ b/amanuensis/backend/lexicon.py @@ -67,7 +67,9 @@ def get_all(db: DbContext) -> Sequence[Lexicon]: def get_joined(db: DbContext, user_id: int) -> Sequence[Lexicon]: """Get all lexicons that a player is in.""" - return db(select(Lexicon).join(Lexicon.memberships).where(Membership.user_id == user_id)).scalars() + return db( + select(Lexicon).join(Lexicon.memberships).where(Membership.user_id == user_id) + ).scalars() def get_public(db: DbContext) -> Sequence[Lexicon]: diff --git a/amanuensis/cli/lexicon.py b/amanuensis/cli/lexicon.py index dfa44a2..2d580d2 100644 --- a/amanuensis/cli/lexicon.py +++ b/amanuensis/cli/lexicon.py @@ -20,6 +20,9 @@ LOG = logging.getLogger(__name__) @add_argument("user") @add_argument("--editor", action="store_true") def command_add(args) -> int: + """ + Add a user to a lexicon. + """ db: DbContext = args.get_db() lexicon = lexiq.from_name(db, args.lexicon) user = userq.from_username(db, args.user) diff --git a/pytest.ini b/pytest.ini index 73414ad..555980a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -addopts = --show-capture=log +addopts = --show-capture=stdout ; pytest should be able to read the pyproject.toml file, but for some reason it ; doesn't seem to be working here. This file is a temporary fix until that gets ; resolved. \ No newline at end of file