stop hudcache updating again when importing duplicate hands

This commit is contained in:
sqlcoder 2010-02-20 17:49:03 +00:00
parent ebf2205859
commit 141b88ecfd
2 changed files with 4 additions and 1 deletions

View File

@ -125,6 +125,7 @@ class Hand(object):
# currency symbol for this hand
self.sym = self.SYMBOL[self.gametype['currency']] # save typing! delete this attr when done
self.pot.setSym(self.sym)
self.is_duplicate = False # i.e. don't update hudcache if true
def __str__(self):
vars = ( ("BB", self.bb),
@ -236,6 +237,7 @@ db: a connected Database object"""
# TourneysPlayers
else:
log.info("Hand.insert(): hid #: %s is a duplicate" % hh['siteHandNo'])
self.is_duplicate = True # i.e. don't update hudcache
raise FpdbHandDuplicate(hh['siteHandNo'])
def updateHudCache(self, db):
@ -669,6 +671,7 @@ class HoldemOmahaHand(Hand):
if self.maxseats is None:
self.maxseats = hhc.guessMaxSeats(self)
hhc.readOther(self)
#print "\nHand:\n"+str(self)
elif builtFrom == "DB":
if handid is not None:
self.select(handid) # Will need a handId

View File

@ -456,7 +456,7 @@ class Importer:
# FIXME: Need to test for bulk import that isn't rebuilding the cache
if self.callHud:
for hand in handlist:
if hand is not None:
if hand is not None and not hand.is_duplicate:
hand.updateHudCache(self.database)
self.database.commit()