Compare commits
1 Commits
3555558bd9
...
ed34d22825
Author | SHA1 | Date |
---|---|---|
Nikolai | ed34d22825 |
|
@ -41,13 +41,14 @@ def create(
|
||||||
lex: Lexicon = db(
|
lex: Lexicon = db(
|
||||||
select(Lexicon).where(Lexicon.id == lexicon_id)
|
select(Lexicon).where(Lexicon.id == lexicon_id)
|
||||||
).scalar_one_or_none()
|
).scalar_one_or_none()
|
||||||
|
assert lex, "could not find lexicon"
|
||||||
|
|
||||||
# Verify lexicon is joinable; current no Lexicons are joinable so this is commented out
|
# Verify lexicon is joinable
|
||||||
if not lex.joinable:
|
if not lex.joinable:
|
||||||
raise ArgumentError("Can't join: Lexicon is not joinable")
|
raise ArgumentError("Can't join: Lexicon is not joinable")
|
||||||
|
|
||||||
# Verify lexicon is not full
|
# Verify lexicon is not full
|
||||||
if lex.player_limit:
|
if lex.player_limit is not None:
|
||||||
if (
|
if (
|
||||||
db(select(func.count()).where(Membership.lexicon_id == lexicon_id)).scalar()
|
db(select(func.count()).where(Membership.lexicon_id == lexicon_id)).scalar()
|
||||||
>= lex.player_limit
|
>= lex.player_limit
|
||||||
|
|
Loading…
Reference in New Issue