From 03deefc1a348ec19293ef307fe4aedee428f5c48 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 17 Dec 2009 01:55:48 +0800 Subject: [PATCH] [NEWIMPORT] Fix thinko on insertPlayer Was returning the player name instead of id in the case where the player exists in the database, but wasn't cached already Removing some merge gunge too --- pyfpdb/Database.py | 6 ++++-- pyfpdb/SQL.py | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 408844ae..36d5bc93 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1857,8 +1857,10 @@ class Database: ,(name, site_id)) #Get last id might be faster here. #c.execute ("SELECT id FROM Players WHERE name=%s", (name,)) - tmp = [self.get_last_insert_id(c)] - return tmp[0] + result = self.get_last_insert_id(c) + else: + result = tmp[1] + return result def insertGameTypes(self, row): c = self.get_cursor() diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index e670cfa4..2ccd7f90 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2787,8 +2787,6 @@ class Sql: ,hp.tourneyTypeId ,date_format(h.handStart, 'd%y%m%d') """ -#>>>>>>> 28ca49d592c8e706ad6ee58dd26655bcc33fc5fb:pyfpdb/SQL.py -#""" elif db_server == 'postgresql': self.query['rebuildHudCache'] = """ INSERT INTO HudCache