Update views.py
This commit is contained in:
parent
11c8e46b26
commit
a468904356
1 changed files with 3 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
from flask import g, abort, render_template
|
from flask import g, abort, render_template
|
||||||
|
from lnbits.core.crud import get_wallet
|
||||||
|
|
||||||
from lnbits.decorators import check_user_exists, validate_uuids
|
from lnbits.decorators import check_user_exists, validate_uuids
|
||||||
from lnbits.extensions.tpos import tpos_ext
|
from lnbits.extensions.tpos import tpos_ext
|
||||||
|
|
@ -19,9 +20,7 @@ def index():
|
||||||
@tpos_ext.route("/<tpos_id>")
|
@tpos_ext.route("/<tpos_id>")
|
||||||
def tpos(tpos_id):
|
def tpos(tpos_id):
|
||||||
tpos = get_tpos(tpos_id) or abort(Status.NOT_FOUND, "tpos does not exist.")
|
tpos = get_tpos(tpos_id) or abort(Status.NOT_FOUND, "tpos does not exist.")
|
||||||
print(tpos)
|
|
||||||
r = requests.get("https://api.opennode.co/v1/rates")
|
r = requests.get("https://api.opennode.co/v1/rates")
|
||||||
r_json = r.json()
|
r_json = r.json()
|
||||||
print(r_json["data"]["BTC" + tpos.currency][tpos.currency])
|
rr = get_wallet(tpos.wallet)
|
||||||
|
return render_template("tpos/tpos.html", tpos=tpos.id, inkey=rr.inkey, rate=r_json["data"]["BTC" + tpos.currency][tpos.currency])
|
||||||
return render_template("tpos/tpos.html", tpos=tpos, rate=r_json["data"]["BTC" + tpos.currency][tpos.currency])
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue