mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-19 21:31:27 +02:00
fix: correct db.cursor() usage on lnurlp.
This commit is contained in:
parent
79d5befe0c
commit
ac20e06dc3
@ -7,21 +7,21 @@ from .models import PayLink
|
|||||||
|
|
||||||
def create_pay_link(*, wallet_id: str, description: str, amount: int) -> PayLink:
|
def create_pay_link(*, wallet_id: str, description: str, amount: int) -> PayLink:
|
||||||
with open_ext_db("lnurlp") as db:
|
with open_ext_db("lnurlp") as db:
|
||||||
with db.cursor() as c:
|
db.execute(
|
||||||
c.execute(
|
"""
|
||||||
"""
|
INSERT INTO pay_links (
|
||||||
INSERT INTO pay_links (
|
wallet,
|
||||||
wallet,
|
description,
|
||||||
description,
|
amount,
|
||||||
amount,
|
served_meta,
|
||||||
served_meta,
|
served_pr
|
||||||
served_pr
|
|
||||||
)
|
|
||||||
VALUES (?, ?, ?, 0, 0)
|
|
||||||
""",
|
|
||||||
(wallet_id, description, amount),
|
|
||||||
)
|
)
|
||||||
return get_pay_link(c.lastrowid)
|
VALUES (?, ?, ?, 0, 0)
|
||||||
|
""",
|
||||||
|
(wallet_id, description, amount),
|
||||||
|
)
|
||||||
|
link_id = db.cursor.lastrowid
|
||||||
|
return get_pay_link(link_id)
|
||||||
|
|
||||||
|
|
||||||
def get_pay_link(link_id: str) -> Optional[PayLink]:
|
def get_pay_link(link_id: str) -> Optional[PayLink]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user