Skip to content

Commit

Permalink
fix(update_api_key): not updating updated_at
Browse files Browse the repository at this point in the history
  • Loading branch information
jayceslesar committed Jul 22, 2024
1 parent add134c commit 080d92d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions masterbase/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,10 @@ def check_steam_id_has_api_key(engine: Engine, steam_id: str) -> str | None:
def update_api_key(engine: Engine, steam_id: str, new_api_key: str) -> None:
"""Update an API key."""
with engine.connect() as conn:
updated_at = datetime.now().astimezone(timezone.utc).isoformat()
conn.execute(
sa.text("UPDATE api_keys SET api_key = :new_api_key WHERE steam_id = :steam_id"),
{"steam_id": steam_id, "new_api_key": new_api_key},
sa.text("UPDATE api_keys SET api_key = :new_api_key, updated_at = :updated_at WHERE steam_id = :steam_id"),
{"steam_id": steam_id, "updated_at": updated_at, "new_api_key": new_api_key},
)
conn.commit()

Expand Down

0 comments on commit 080d92d

Please sign in to comment.