Another Step in the Quest to clean up the code base.

This commit is contained in:
2017-09-08 07:19:50 +02:00
parent ce218080b2
commit b3ab9798b5
229 changed files with 1915 additions and 15175 deletions

View File

@@ -167,11 +167,11 @@ class Hanchan(models.Model):
_('Comment'), blank=True, max_length=255, editable=False)
comment = models.TextField(_('Comment'), blank=True)
confirmed = models.BooleanField(_('Has been Confirmed'), default=True,
help_text=_(
'Only valid and confirmed Hanchans '
'will be counted in the rating.')
)
confirmed = models.BooleanField(
_('Has been Confirmed'), default=True,
help_text=_('Only valid and confirmed Hanchans will be counted in the '
'rating.')
)
player_names = models.CharField(max_length=255, editable=False)
season = models.PositiveSmallIntegerField(
_('Season'), editable=False, db_index=True)
@@ -622,17 +622,17 @@ def update_ranking(sender, instance, **kwargs):
{'user': user, 'start': str(instance.start.date())}
)
set_dirty(user=user.id, hanchan_date=instance.start.date())
logger.debug("marking event %s for recalculation.", instance.event)
set_dirty(event=instance.event_id, user=user.id)
if instance.season:
logger.debug(
"marking %s's ladder %i season for recalculation.",
user, instance.season
)
set_dirty(user=user.id, season=instance.season)
logger.debug("marking season %d for recalculation.", instance.season)
set_dirty(season=instance.season)
logger.debug("marking event %s for recalculation.", instance.event)
set_dirty(event=instance.event_id, user=user.id)
models.signals.pre_delete.connect(update_ranking, sender=Hanchan)
# models.signals.post_save.connect(update_ranking, sender=Hanchan)