diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index f2e07ef..b647b5c 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -136,7 +136,7 @@ class TeamRegistration(SideStoreModel): def set_weight(self): 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): return self.players_sorted_by_rank.count() > 0 or self.name is not None diff --git a/tournaments/signals.py b/tournaments/signals.py index 7743a48..90e5731 100644 --- a/tournaments/signals.py +++ b/tournaments/signals.py @@ -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: return + print("warn_team_walkout_status_change", instance) previous_instance = None try: previous_instance = TeamRegistration.objects.get(id=instance.id) except TeamRegistration.DoesNotExist: + print("TeamRegistration.DoesNotExist") return