From: Ant Zucaro Date: Sat, 12 Nov 2016 14:36:00 +0000 (-0500) Subject: Use better formatted filters. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e614832ffdd90cde5bfba6c846606721e1a2c173;p=xonotic%2Fxonstat.git Use better formatted filters. --- 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)