From: Ant Zucaro <azucaro@gmail.com>
Date: Sat, 7 Nov 2015 15:09:57 +0000 (-0500)
Subject: Use only one regex to identify bots
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e8e0da3896ca31071f975141aaf5dd59cc82f2db;p=xonotic%2Fxonstat.git

Use only one regex to identify bots

Two is wasteful.
---

diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py
index 0fa55de..12e1c65 100644
--- a/xonstat/views/submission.py
+++ b/xonstat/views/submission.py
@@ -521,7 +521,7 @@ def get_or_create_player(session=None, hashkey=None, nick=None):
     nick - nick of the player (in case of a first time create)
     """
     # if we have a bot
-    if re.search('^bot#\d+$', hashkey) or re.search('^bot#\d+#', hashkey):
+    if re.search('^bot#\d+', hashkey):
         player = session.query(Player).filter_by(player_id=1).one()
     # if we have an untracked player
     elif re.search('^player#\d+$', hashkey):