]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Use better formatted filters.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 12 Nov 2016 14:36:00 +0000 (09:36 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 12 Nov 2016 14:36:00 +0000 (09:36 -0500)
xonstat/views/server.py

index 5d9860cceac9d3948ec6bd40b42a29c8e46d8754..929517fd9496626077cdf9d419b26d06db446776 100644 (file)
@@ -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)