From 72730291f01967118bdcfde7146e890e5de481e8 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Sat, 27 Feb 2010 09:35:18 +0200 Subject: [PATCH] Fix HUD-cache updates on Postgres The value in pdata[p]['position'] is a string. Change the 'pos' dictionary keys to strings, and to prevent potential breakage on other databases, always enforce that the looked up key is first converted to string. --- pyfpdb/Database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 0303aad2..069789f3 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1703,8 +1703,8 @@ class Database: line[55] = gid # gametypeId line[56] = pids[p] # playerId line[57] = len(pids) # activeSeats - pos = {'B':'B', 'S':'S', 0:'D', 1:'C', 2:'M', 3:'M', 4:'M', 5:'E', 6:'E', 7:'E', 8:'E', 9:'E' } - line[58] = pos[pdata[p]['position']] + pos = {'B':'B', 'S':'S', '0':'D', '1':'C', '2':'M', '3':'M', '4':'M', '5':'E', '6':'E', '7':'E', '8':'E', '9':'E' } + line[58] = pos[str(pdata[p]['position'])] line[59] = pdata[p]['tourneyTypeId'] line[60] = styleKey # styleKey inserts.append(line)