[Cards] Change all instances of uuid to key

This commit is contained in:
2026-06-27 15:06:05 +02:00
parent 17b99041db
commit eec575c619
7 changed files with 16 additions and 16 deletions

View File

@@ -16,14 +16,14 @@ debug_router = APIRouter(
def add_card_manually(groupid: int, card_key: str, db: Session=Depends(get_session)):
"""Add cards manually (you also have to delete them manually)"""
logger.critical(f"Manual db change: adding a card with key: {card_key} to group: {groupid}")
card = Card(group_id=groupid, uuid=card_key)
card = Card(group_id=groupid, key=card_key)
add_and_refresh(db, card)
return card
@debug_router.get("/rmcard/{card_key}")
def remove_card_manually(card_key: str, db: Session = Depends(get_session)):
logger.critical(f"Manual db change: removing a card with key: {card_key}")
card = db.exec(select(Card).where(Card.uuid == card_key)).one()
card = db.exec(select(Card).where(Card.key == card_key)).one()
add_and_refresh(db, card)
@debug_router.put("/getcards")
@@ -33,5 +33,5 @@ def list_all_cards(db: Session = Depends(get_session)):
print(cards)
out = []
for i in cards:
out.append({i.uuid: i.group.name})
out.append({i.key: i.group.name})
return out