OnGame: remove non-digits from hand id

Fixing email reported error with MySQL:

fpdb starting ...Traceback (most recent call last):
  File "GuiBulkImport.pyc", line 107, in load_clicked
  File "fpdb_import.pyc", line 251, in runImport
  File "fpdb_import.pyc", line 314, in importFiles
  File "fpdb_import.pyc", line 482, in import_file_dict
  File "Hand.pyc", line 273, in insert
  File "Database.pyc", line 1651, in storeHand
  File "MySQLdb\cursors.pyc", line 174, in execute
  File "MySQLdb\connections.pyc", line 36, in defaulterrorhandler
_mysql_exceptions.OperationalError: (1366, "Incorrect integer value: 'R5-79731715-280' for column 'siteHandNo' at row 1")
This commit is contained in:
Worros 2010-09-09 10:31:40 +08:00
parent 3b55bd19db
commit bdb0bda3a0

View File

@ -229,6 +229,9 @@ class OnGame(HandHistoryConverter):
hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, tzoffset, "UTC")
if key == 'HID':
hand.handid = info[key]
# Need to remove non-alphanumerics for MySQL
hand.handid = hand.handid.replace('R','')
hand.handid = hand.handid.replace('-','')
if key == 'TABLE':
hand.tablename = info[key]