From 31bf6e10efc7122cd2d5f6cb2256c8e42ea46c47 Mon Sep 17 00:00:00 2001 From: Ivan Filippov Date: Fri, 29 Apr 2016 10:29:08 -0600 Subject: [PATCH] Fixed all domains being visible to all users on dashboard. --- app/templates/dashboard.html | 4 ++-- app/views.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 94d2569..cbd8a13 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -31,8 +31,8 @@
-

{{ domains|length }}

-

{% if domains|length > 1 %}Domains{% else %}Domain{% endif %}

+

{{ domain_count }}

+

{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}

diff --git a/app/views.py b/app/views.py index 49d43be..873ae3f 100644 --- a/app/views.py +++ b/app/views.py @@ -136,7 +136,7 @@ def dashboard(): domains = User(id=current_user.id).get_domain() # stats for dashboard - domains = Domain.query.all() + domain_count = Domain.query.count() users = User.query.all() history_number = History.query.count() history = History.query.limit(4) @@ -146,7 +146,7 @@ def dashboard(): uptime = filter(lambda uptime: uptime['name'] == 'uptime', statistics)[0]['value'] else: uptime = 0 - return render_template('dashboard.html', domains=domains, users=users, history_number=history_number, uptime=uptime, histories=history) + return render_template('dashboard.html', domains=domains, domain_count=domain_count, users=users, history_number=history_number, uptime=uptime, histories=history) @app.route('/domain/', methods=['GET', 'POST'])