From: Ant Zucaro Date: Sat, 12 Nov 2016 14:36:20 +0000 (-0500) Subject: Add the active filter for servers on the search page. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=629267a4325c1c8b8c03b57405e37dc4ce6fc412;p=xonotic%2Fxonstat.git Add the active filter for servers on the search page. --- diff --git a/xonstat/views/search.py b/xonstat/views/search.py index b9d4675..1cceca7 100644 --- a/xonstat/views/search.py +++ b/xonstat/views/search.py @@ -26,14 +26,13 @@ def search_q(nick=None, server_name=None, map_name=None, create_dt=None, order_by(Player.player_id) # server-only searches - elif server_name and not nick and not map_name and not create_dt \ - and len(gametypes) < 1: + elif server_name and not nick and not map_name and not create_dt and len(gametypes) < 1: result_type = "server" q = session.query(Server) if server_name: - q = q.filter(func.upper(Server.name).\ - like('%'+server_name.upper()+'%')).\ - order_by(Server.server_id) + q = q.filter(func.upper(Server.name).like('%'+server_name.upper()+'%'))\ + .filter(Server.active_ind)\ + .order_by(Server.server_id) # map-only searches elif map_name and not nick and not server_name and not create_dt \ @@ -50,6 +49,7 @@ def search_q(nick=None, server_name=None, map_name=None, create_dt=None, result_type = "game" q = session.query(Game, Server, Map).\ filter(Game.server_id == Server.server_id).\ + filter(Server.active_ind).\ filter(Game.map_id == Map.map_id).\ order_by(Game.game_id.desc()) if len(gametypes) > 0: