]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Use only one regex to identify bots
authorAnt Zucaro <azucaro@gmail.com>
Sat, 7 Nov 2015 15:09:57 +0000 (10:09 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 7 Nov 2015 15:09:57 +0000 (10:09 -0500)
Two is wasteful.

xonstat/views/submission.py

index 0fa55de1ddefd262935bbf7a95b0779bfdc3faef..12e1c65d67d4f435947115a48d1f1fc94f033f2d 100644 (file)
@@ -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):