From d09ede568148e1a8309e4f7f21f52a4d55316a10 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sat, 8 Apr 2017 03:35:30 -0700 Subject: [PATCH] Fix duplicates embed members in sidebar --- titanembeds/blueprints/api/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/titanembeds/blueprints/api/api.py b/titanembeds/blueprints/api/api.py index 26d5409..89bafa0 100644 --- a/titanembeds/blueprints/api/api.py +++ b/titanembeds/blueprints/api/api.py @@ -191,8 +191,8 @@ def get_online_discord_users(guild_id): def get_online_embed_users(guild_id): time_past = (datetime.datetime.now() - datetime.timedelta(seconds = 120)).strftime('%Y-%m-%d %H:%M:%S') - unauths = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.last_timestamp > time_past, UnauthenticatedUsers.revoked == False).all() - auths = db.session.query(AuthenticatedUsers).filter(AuthenticatedUsers.last_timestamp > time_past).all() + unauths = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.last_timestamp > time_past, UnauthenticatedUsers.revoked == False, UnauthenticatedUsers.guild_id == guild_id).all() + auths = db.session.query(AuthenticatedUsers).filter(AuthenticatedUsers.last_timestamp > time_past, AuthenticatedUsers.guild_id == guild_id).all() users = {'unauthenticated':[], 'authenticated':[]} for user in unauths: meta = {