fix mail doubling

timetoconfirm
Raz 7 months ago
parent 9454d932d5
commit 1e9ab3a8e7
  1. 2
      tournaments/models/team_registration.py
  2. 2
      tournaments/signals.py

@ -136,7 +136,7 @@ class TeamRegistration(SideStoreModel):
def set_weight(self): def set_weight(self):
self.weight = self.players_sorted_by_rank.aggregate(total_weight=models.Sum('computed_rank'))['total_weight'] or 0 self.weight = self.players_sorted_by_rank.aggregate(total_weight=models.Sum('computed_rank'))['total_weight'] or 0
self.save() # Save the updated weight if necessary
def is_valid_for_summon(self): def is_valid_for_summon(self):
return self.players_sorted_by_rank.count() > 0 or self.name is not None return self.players_sorted_by_rank.count() > 0 or self.name is not None

@ -144,10 +144,12 @@ def warn_team_walkout_status_change(sender, instance, **kwargs):
if instance.id is None or instance.tournament is None or instance.tournament.enable_online_registration is False: if instance.id is None or instance.tournament is None or instance.tournament.enable_online_registration is False:
return return
print("warn_team_walkout_status_change", instance)
previous_instance = None previous_instance = None
try: try:
previous_instance = TeamRegistration.objects.get(id=instance.id) previous_instance = TeamRegistration.objects.get(id=instance.id)
except TeamRegistration.DoesNotExist: except TeamRegistration.DoesNotExist:
print("TeamRegistration.DoesNotExist")
return return

Loading…
Cancel
Save