Compare commits
No commits in common. "07b1f12e9693c7ef030e7a2cb845df2b5849d734" and "030ba05ab6e6372f10354adc8e284503b96131a5" have entirely different histories.
07b1f12e96
...
030ba05ab6
|
@ -42,7 +42,8 @@ def create(
|
||||||
|
|
||||||
# get reference to lexicon for next few checks
|
# get reference to lexicon for next few checks
|
||||||
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()
|
||||||
|
|
||||||
# Verify lexicon is joinable; current no Lexicons are joinable so this is commented out
|
# 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
|
# Verify lexicon is not full
|
||||||
if lex.player_limit:
|
if lex.player_limit:
|
||||||
if (
|
if (
|
||||||
db(select(func.count()).where(Membership.lexicon_id == lexicon_id)).scalar()
|
db(
|
||||||
>= lex.player_limit
|
select(func.count())
|
||||||
|
.where(Membership.lexicon_id == lexicon_id)
|
||||||
|
).scalar()
|
||||||
|
>= lex.player_limit
|
||||||
):
|
):
|
||||||
raise ArgumentError("Can't join: Lexicon is full")
|
raise ArgumentError("Can't join: Lexicon is full")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue