From 6d296e22950f97aa1a46a67cd5d74cbe9c8967ff Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 11 Nov 2018 04:55:30 +0000 Subject: [PATCH] Limit unauth members to show at most 500 in admin guid page --- webapp/titanembeds/blueprints/admin/admin.py | 2 +- webapp/titanembeds/blueprints/user/user.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/titanembeds/blueprints/admin/admin.py b/webapp/titanembeds/blueprints/admin/admin.py index 40c4d58..315b8d1 100644 --- a/webapp/titanembeds/blueprints/admin/admin.py +++ b/webapp/titanembeds/blueprints/admin/admin.py @@ -170,7 +170,7 @@ def administrate_guild(guild_id): permissions.append("Manage Embed Settings") permissions.append("Ban Members") permissions.append("Kick Members") - all_members = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.guild_id == guild_id).order_by(UnauthenticatedUsers.id).all() + all_members = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.guild_id == guild_id).order_by(UnauthenticatedUsers.id).limit(500).all() all_bans = db.session.query(UnauthenticatedBans).filter(UnauthenticatedBans.guild_id == guild_id).all() users = prepare_guild_members_list(all_members, all_bans) dbguild_dict = { diff --git a/webapp/titanembeds/blueprints/user/user.py b/webapp/titanembeds/blueprints/user/user.py index ec4f1af..77a867c 100644 --- a/webapp/titanembeds/blueprints/user/user.py +++ b/webapp/titanembeds/blueprints/user/user.py @@ -207,7 +207,7 @@ def administrate_guild(guild_id): if check_user_permission(guild_id, 1): permissions.append("Kick Members") cosmetics = db.session.query(Cosmetics).filter(Cosmetics.user_id == session['user_id']).first() - all_members = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.guild_id == guild_id).order_by(UnauthenticatedUsers.id).all() + all_members = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.guild_id == guild_id).order_by(UnauthenticatedUsers.id).limit(500).all() all_bans = db.session.query(UnauthenticatedBans).filter(UnauthenticatedBans.guild_id == guild_id).all() users = prepare_guild_members_list(all_members, all_bans) dbguild_dict = {