From ab1c703baf90ecddfdfe00542d1bb82d2bb46d7e Mon Sep 17 00:00:00 2001 From: Bernard Siebens Date: Tue, 11 Aug 2026 13:54:32 +0200 Subject: [PATCH] Send the groups list Edit button to the group page, not the rename form Every other list page with a detail view (Teams, Members, News, Events) has Edit land on the overview; groups jumped straight to the rename form, skipping the page where the members actually are. The group page already carries its own Edit action, so nothing becomes unreachable. The list pages that legitimately do go straight to a form -- Locations, Opponents, Sponsors, Positions, Referee levels -- have no detail view at all, which is why they stay as they are. Noted in the test so the inconsistency doesn't read as one. Co-Authored-By: Claude Opus 5 --- management/templates/management/group_list.html | 2 +- management/tests.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/management/templates/management/group_list.html b/management/templates/management/group_list.html index 8e868de..8af820a 100644 --- a/management/templates/management/group_list.html +++ b/management/templates/management/group_list.html @@ -27,7 +27,7 @@ {{ group.member_count }} diff --git a/management/tests.py b/management/tests.py index 5d7c27d..b163e96 100644 --- a/management/tests.py +++ b/management/tests.py @@ -824,6 +824,19 @@ class GroupManagementTests(ManagementTestBase): self.client.force_login(self.make_non_admin_coach()) self.assertEqual(self.club_get("group_list").status_code, 403) + def test_the_lists_edit_button_goes_to_the_group_page_not_straight_to_the_form(self): + # Same as Teams: Edit lands on the overview, which is where the members + # live, and offers its own Edit for the rename form. The list pages that + # do jump straight to a form (Locations, Opponents, Sponsors, Positions, + # Referee levels) have no detail page to land on at all. + group = Group.objects.create(club=self.club, name="Referees") + self.client.force_login(self.admin_user) + + response = self.club_get("group_list") + + self.assertContains(response, reverse("management:group_detail", args=[group.pk])) + self.assertNotContains(response, reverse("management:group_update", args=[group.pk])) + def test_admin_can_create_a_group(self): self.client.force_login(self.admin_user)