fix: wrong typing in DB columns (#51)

* fix: wrong typing in DB columns
* fix: update
* fix: migrations
* chore: lint
This commit is contained in:
Tiago Vasconcelos 2025-04-15 12:29:34 +01:00 committed by GitHub
commit 79c74708e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 79 additions and 12 deletions

View file

@ -71,7 +71,6 @@ async def api_card_update(
card_id: str,
wallet: WalletTypeInfo = Depends(require_admin_key),
) -> Card:
card = await get_card(card_id)
if not card:
raise HTTPException(
@ -85,8 +84,9 @@ async def api_card_update(
detail="UID already registered. Delete registered card and try again.",
status_code=HTTPStatus.BAD_REQUEST,
)
card = await update_card(card_id, **data.dict())
assert card, "update_card should always return a card"
for key, value in data.dict().items():
setattr(card, key, value)
await update_card(card)
return card