From e614832ffdd90cde5bfba6c846606721e1a2c173 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 12 Nov 2016 09:36:00 -0500 Subject: [PATCH] Use better formatted filters. --- xonstat/views/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xonstat/views/server.py b/xonstat/views/server.py index 5d9860c..929517f 100644 --- a/xonstat/views/server.py +++ b/xonstat/views/server.py @@ -33,7 +33,7 @@ class ServerIndex(object): """Returns the raw data shared by all renderers.""" try: server_q = DBSession.query(Server)\ - .filter(Server.active_ind==True)\ + .filter(Server.active_ind)\ .order_by(Server.server_id.desc()) servers = Page(server_q, self.page, items_per_page=25, url=page_url) @@ -295,8 +295,8 @@ class ServerInfo(ServerInfoBase): # this view uses data from other views, so we'll save the data at that level try: self.server = DBSession.query(Server)\ - .filter_by(active_ind=True) \ - .filter_by(server_id=self.server_id)\ + .filter(Server.active_ind)\ + .filter(Server.server_id == self.server_id)\ .one() self.top_maps_v = ServerTopMaps(self.request, limit=LEADERBOARD_COUNT) -- 2.39.2