Compare commits
1 Commits
07b1f12e96
...
6bda9b4b0a
Author | SHA1 | Date |
---|---|---|
Nikolai | 6bda9b4b0a |
|
@ -42,7 +42,8 @@ def create(
|
|||
|
||||
# get reference to lexicon for next few checks
|
||||
lex: Lexicon = db(
|
||||
select(Lexicon).where(Lexicon.id == lexicon_id)
|
||||
select(Lexicon)
|
||||
.where(Lexicon.id == lexicon_id)
|
||||
).scalar_one_or_none()
|
||||
|
||||
# Verify lexicon is joinable; current no Lexicons are joinable so this is commented out
|
||||
|
@ -52,8 +53,11 @@ def create(
|
|||
# Verify lexicon is not full
|
||||
if lex.player_limit:
|
||||
if (
|
||||
db(select(func.count()).where(Membership.lexicon_id == lexicon_id)).scalar()
|
||||
>= lex.player_limit
|
||||
db(
|
||||
select(func.count())
|
||||
.where(Membership.lexicon_id == lexicon_id)
|
||||
).scalar()
|
||||
>= lex.player_limit
|
||||
):
|
||||
raise ArgumentError("Can't join: Lexicon is full")
|
||||
|
||||
|
|
Loading…
Reference in New Issue