Skip to content

Commit

Permalink
Fix teamslot not being editable from admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
KwikKill committed Dec 27, 2024
1 parent 7e61ccc commit 80c1f7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion insalan/tournament/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions insalan/tournament/models/seat_slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down

0 comments on commit 80c1f7e

Please sign in to comment.