Update views.py
This commit is contained in:
parent
222f04f893
commit
0baea37447
1 changed files with 12 additions and 0 deletions
|
|
@ -9,6 +9,18 @@ from lnbits.extensions.example import example_ext
|
||||||
@example_ext.route("/")
|
@example_ext.route("/")
|
||||||
def index():
|
def index():
|
||||||
"""Try to add descriptions for others."""
|
"""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(
|
return render_template(
|
||||||
"example/index.html"
|
"example/index.html"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue