bugfix: dashboard no longer breaks w/ empty queue
This commit is contained in:
parent
55ab9c774a
commit
53b4419ed4
|
@ -8,7 +8,8 @@ bp = Blueprint('redeem_dashboard', __name__)
|
||||||
def dashboard():
|
def dashboard():
|
||||||
queue = pretty_redeem_queue(get_db())
|
queue = pretty_redeem_queue(get_db())
|
||||||
number_of_drinks = 0
|
number_of_drinks = 0
|
||||||
for row in queue:
|
if queue is not None:
|
||||||
if row[1] == "drink":
|
for row in queue:
|
||||||
number_of_drinks += 1
|
if row[1] == "drink":
|
||||||
|
number_of_drinks += 1
|
||||||
return render_template('dashboard.html', queue=queue, number_of_drinks=number_of_drinks)
|
return render_template('dashboard.html', queue=queue, number_of_drinks=number_of_drinks)
|
|
@ -11,7 +11,7 @@
|
||||||
<td> {{ number_of_drinks }} </td>
|
<td> {{ number_of_drinks }} </td>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
{% if queue %}
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -28,5 +28,6 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue