diff --git a/insalan/tournament/admin.py b/insalan/tournament/admin.py index 8a3da525..645d3d6a 100644 --- a/insalan/tournament/admin.py +++ b/insalan/tournament/admin.py @@ -29,6 +29,7 @@ from django.utils.html import escape from django.utils.translation import gettext as _ from django.views.decorators.debug import sensitive_post_parameters +from django.db.models import Q from insalan.mailer import MailManager from insalan.tournament.manage import ( @@ -411,7 +412,7 @@ def __init__(self, *args, **kwargs): seat_slot.queryset = seat_slot.queryset.filter( tournament=self.instance.tournament ).filter( - team=None + Q(team=None) | Q(team=self.instance) ) def clean(self): diff --git a/insalan/tournament/models/seat_slot.py b/insalan/tournament/models/seat_slot.py index fabb53b2..ca96e5d9 100644 --- a/insalan/tournament/models/seat_slot.py +++ b/insalan/tournament/models/seat_slot.py @@ -20,6 +20,9 @@ class SeatSlot(models.Model): verbose_name=_("Place"), ) + def __str__(self): + return f"SeatSlot {self.id} for {self.tournament.name}" + class Meta: """Meta Options"""