From 73e3bab6b34f4b728a2e9fc5d1e116af0c272a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Tue, 3 Sep 2024 22:13:51 +0200 Subject: [PATCH] fix: use timestamp placeholder for postgres compat (#51) * fix: use timestamp placeholder for postgres compat --------- Co-authored-by: Vlad Stan --- crud.py | 5 +++-- models.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crud.py b/crud.py index 7829338..3e7ee6d 100644 --- a/crud.py +++ b/crud.py @@ -17,7 +17,7 @@ async def create_withdraw_link( link_id = urlsafe_short_hash()[:22] available_links = ",".join([str(i) for i in range(data.uses)]) await db.execute( - """ + f""" INSERT INTO withdraw.withdraw_link ( id, wallet, @@ -37,7 +37,8 @@ async def create_withdraw_link( custom_url, created_at ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES + (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, {db.timestamp_placeholder}) """, ( link_id, diff --git a/models.py b/models.py index cdf35fe..aa03907 100644 --- a/models.py +++ b/models.py @@ -2,9 +2,15 @@ import datetime import shortuuid from fastapi import Query, Request -from lnurl import Lnurl, LnurlWithdrawResponse + +# TODO remove type: ignore when 0.12.11 is released +from lnurl import ( # type: ignore + ClearnetUrl, # type: ignore + Lnurl, + LnurlWithdrawResponse, + MilliSatoshi, # type: ignore +) from lnurl import encode as lnurl_encode -from lnurl.models import ClearnetUrl, MilliSatoshi from pydantic import BaseModel