Fixed POST /cardsets bug
This commit is contained in:
parent
fe88e517eb
commit
f3e3dfc480
2
main.py
2
main.py
@ -1047,7 +1047,7 @@ async def v1_cardsets_post(cardset: CardsetModel, token: str = Depends(oauth2_sc
|
||||
detail='You are not authorized to post cardsets. This event has been logged.'
|
||||
)
|
||||
|
||||
dupe_set = Cardset.get_or_none(Cardset.name)
|
||||
dupe_set = Cardset.get_or_none(Cardset.name == cardset.name)
|
||||
if dupe_set:
|
||||
db.close()
|
||||
raise HTTPException(status_code=400, detail=f'There is already a cardset using {cardset.name}')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user