FIXED: 9th Dan is the highest possible Dan, so you can't advanced higher with 3 wins in an row.
This commit is contained in:
@@ -313,7 +313,7 @@ class Hanchan(models.Model):
|
||||
reverse=True)
|
||||
|
||||
def save(self, **kwargs):
|
||||
self.season = self.event.mahjong_season or date.today().year
|
||||
self.season = self.event.mahjong_season or self.start.year
|
||||
self.full_clean()
|
||||
self.compute_player_placements()
|
||||
return models.Model.save(self, **kwargs)
|
||||
@@ -361,7 +361,7 @@ class KyuDanRanking(models.Model):
|
||||
else:
|
||||
self.wins_in_a_row = 0
|
||||
|
||||
if self.dan and self.wins_in_a_row >= 3:
|
||||
if self.dan and self.wins_in_a_row >= 3 and self.dan < 9:
|
||||
logger.info('adding bonuspoints for 3 wins in a row for %s', self.user)
|
||||
new_dan_rank = self.dan + 1
|
||||
new_dan_points = DAN_RANKS_DICT[new_dan_rank] + 1
|
||||
|
||||
Reference in New Issue
Block a user