Misc touchups

This commit is contained in:
Tim Van Baak 2021-06-23 22:08:33 -07:00
parent 0e5547b883
commit 4284de1cd0
3 changed files with 7 additions and 2 deletions

View File

@ -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]:

View File

@ -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)

View File

@ -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.