Fixed POST /cardsets bug

This commit is contained in:
Cal Corum 2023-02-23 23:49:38 -06:00
parent fe88e517eb
commit f3e3dfc480

View File

@ -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}')