Compare commits

..

1 Commits

1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@
Membership query interface
"""
from _pytest.python_api import raises
from sqlalchemy import select, func
from amanuensis.db import DbContext, Membership
@ -41,7 +42,8 @@ def create(
lex: Lexicon = db(
select(Lexicon).where(Lexicon.id == lexicon_id)
).scalar_one_or_none()
assert lex, "could not find lexicon"
if not lex:
raise ArgumentError("could not find lexicon")
# Verify lexicon is joinable
if not lex.joinable: