new apps.epic.tests.integrated.test_views.PickRolesViewTest.test_pick_roles_idempotent_no_duplicate seats passes w. duplicate no-op post ensures single line addition to apps.epic.views.pick_roles prevents ea. position from drawing twice ea. turn during Role Select phase at table; new assertions in FTs.test_room_role_select.RoleSelectChannelsTest.test_turn_passes_after_selection for same
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-03-21 22:22:06 -04:00
parent f5c2cf4636
commit 184854a2de
3 changed files with 21 additions and 1 deletions

View File

@@ -501,6 +501,12 @@ class PickRolesViewTest(TestCase):
self.client.post(reverse("epic:pick_roles", kwargs={"room_id": self.room.id}))
mock_notify.assert_called_once_with(self.room.id)
def test_pick_roles_idempotent_no_duplicate_seats(self):
url = reverse("epic:pick_roles", kwargs={"room_id": self.room.id})
self.client.post(url)
self.client.post(url) # second call must be a no-op
self.assertEqual(TableSeat.objects.filter(room=self.room).count(), 6)
class SelectRoleViewTest(TestCase):
def setUp(self):

View File

@@ -407,7 +407,7 @@ def select_role(request, room_id):
def pick_roles(request, room_id):
if request.method == "POST":
room = Room.objects.get(id=room_id)
if room.gate_status == Room.OPEN:
if room.gate_status == Room.OPEN and room.table_status is None:
room.table_status = Room.ROLE_SELECT
room.save()
for slot in room.gate_slots.filter(status=GateSlot.FILLED).order_by("slot_number"):