fix club edition page

This commit is contained in:
Thomas Girod 2025-04-04 10:52:58 +02:00
parent 8699750c72
commit c527e87fd1
2 changed files with 12 additions and 1 deletions

View File

@ -27,7 +27,7 @@
</p> </p>
<fieldset class="required margin-bottom"> <fieldset class="required margin-bottom">
{% for field_name in form.admin_fields %} {% for field_name in form.admin_fields %}
{% set field = form.pop(field_name) %} {% set field = form[field_name] %}
<div class="form-group"> <div class="form-group">
{{ field.errors }} {{ field.errors }}
{{ field.label_tag() }} {{ field.label_tag() }}

View File

@ -918,3 +918,14 @@ def test_club_board_member_cannot_edit_club_properties(client: Client):
assert club.name == "old name" assert club.name == "old name"
assert club.is_active assert club.is_active
assert club.address == "new address" assert club.address == "new address"
@pytest.mark.django_db
def test_edit_club_page_doesnt_crash(client: Client):
"""crash test for club:club_edit"""
club = baker.make(Club)
user = subscriber_user.make()
baker.make(Membership, club=club, user=user, role=3)
client.force_login(user)
res = client.get(reverse("club:club_edit", kwargs={"club_id": club.id}))
assert res.status_code == 200