Compare commits
3 Commits
6bda9b4b0a
...
07b1f12e96
Author | SHA1 | Date |
---|---|---|
Nikolai | 07b1f12e96 | |
Nikolai | c2103d8861 | |
Nikolai | 030ba05ab6 |
|
@ -42,8 +42,7 @@ 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)
|
select(Lexicon).where(Lexicon.id == lexicon_id)
|
||||||
.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
|
||||||
|
@ -53,11 +52,8 @@ def create(
|
||||||
# Verify lexicon is not full
|
# Verify lexicon is not full
|
||||||
if lex.player_limit:
|
if lex.player_limit:
|
||||||
if (
|
if (
|
||||||
db(
|
db(select(func.count()).where(Membership.lexicon_id == lexicon_id)).scalar()
|
||||||
select(func.count())
|
>= lex.player_limit
|
||||||
.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