Get home page and login working #14
|
@ -67,7 +67,9 @@ def get_all(db: DbContext) -> Sequence[Lexicon]:
|
||||||
|
|
||||||
def get_joined(db: DbContext, user_id: int) -> Sequence[Lexicon]:
|
def get_joined(db: DbContext, user_id: int) -> Sequence[Lexicon]:
|
||||||
"""Get all lexicons that a player is in."""
|
"""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]:
|
def get_public(db: DbContext) -> Sequence[Lexicon]:
|
||||||
|
|
|
@ -20,6 +20,9 @@ LOG = logging.getLogger(__name__)
|
||||||
@add_argument("user")
|
@add_argument("user")
|
||||||
@add_argument("--editor", action="store_true")
|
@add_argument("--editor", action="store_true")
|
||||||
def command_add(args) -> int:
|
def command_add(args) -> int:
|
||||||
|
"""
|
||||||
|
Add a user to a lexicon.
|
||||||
|
"""
|
||||||
db: DbContext = args.get_db()
|
db: DbContext = args.get_db()
|
||||||
lexicon = lexiq.from_name(db, args.lexicon)
|
lexicon = lexiq.from_name(db, args.lexicon)
|
||||||
user = userq.from_username(db, args.user)
|
user = userq.from_username(db, args.user)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[pytest]
|
[pytest]
|
||||||
addopts = --show-capture=log
|
addopts = --show-capture=stdout
|
||||||
; pytest should be able to read the pyproject.toml file, but for some reason it
|
; 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
|
; doesn't seem to be working here. This file is a temporary fix until that gets
|
||||||
; resolved.
|
; resolved.
|
Loading…
Reference in New Issue