From 0baea37447c0f6a832ed5ff5ad5cdaa122bc48c7 Mon Sep 17 00:00:00 2001 From: Arc <33088785+arcbtc@users.noreply.github.com> Date: Sun, 23 Feb 2020 00:46:38 +0000 Subject: [PATCH] Update views.py --- lnbits/extensions/example/views.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lnbits/extensions/example/views.py b/lnbits/extensions/example/views.py index ac65317..df3cb01 100644 --- a/lnbits/extensions/example/views.py +++ b/lnbits/extensions/example/views.py @@ -9,6 +9,18 @@ from lnbits.extensions.example import example_ext @example_ext.route("/") def index(): """Try to add descriptions for others.""" + usr = request.args.get("usr") + + if usr: + if not len(usr) > 20: + return redirect(url_for("home")) + + # Get all the data + with open_db() as db: + user_wallets = db.fetchall("SELECT * FROM wallets WHERE user = ?", (usr,)) + user_ext = db.fetchall("SELECT extension FROM extensions WHERE user = ? AND active = 1", (usr,)) + user_ext = [v[0] for v in user_ext] + return render_template( "example/index.html" )