dashboard update part 2

This commit is contained in:
Lili (Tlapka) 2022-09-09 12:35:46 +02:00
parent 8622ad0931
commit 7725f1f795
1 changed files with 3 additions and 3 deletions

View File

@ -1,14 +1,14 @@
from flask import render_template, Blueprint
from tlapbot.db import get_db
from tlapbot.owncast_helpers import whole_redeem_queue
from tlapbot.owncast_helpers import pretty_redeem_queue
bp = Blueprint('redeem_dashboard', __name__)
@bp.route('/dashboard',methods=['GET'])
def dashboard():
queue = whole_redeem_queue(get_db())
queue = pretty_redeem_queue(get_db())
number_of_drinks = 0
for row in queue:
if row[2] == "drink":
if row[1] == "drink":
number_of_drinks += 1
return render_template('dashboard.html', queue=queue, number_of_drinks=number_of_drinks)