Event Settings: Make contact_url and imprint_url I18nURLField (Z#23238623) (#6506)

* Event Settings: Make contact_url and imprint_url I18nURLField (Z#23238623)

* isort

* Update doc/api/resources/events.rst

---------

Co-authored-by: Raphael Michel <michel@pretix.eu>
This commit is contained in:
Martin Gross
2026-09-09 09:14:37 +02:00
committed by GitHub
co-authored by Raphael Michel
parent edb4069e18
commit 2c15d8b074
4 changed files with 45 additions and 24 deletions
+21 -7
View File
@@ -1434,8 +1434,12 @@ def test_get_event_settings(token_client, organizer, event):
'/api/v1/organizers/{}/events/{}/settings/'.format(organizer.slug, event.slug),
)
assert resp.status_code == 200
assert resp.data['imprint_url'] == "https://example.org"
assert resp.data['contact_url'] == "https://example.org/contact"
assert resp.data['imprint_url'] == {
"en": "https://example.org",
}
assert resp.data['contact_url'] == {
"en": "https://example.org/contact",
}
assert resp.data['seating_allow_blocked_seats_for_channel'] == []
resp = token_client.get(
@@ -1443,7 +1447,9 @@ def test_get_event_settings(token_client, organizer, event):
)
assert resp.status_code == 200
assert resp.data['imprint_url'] == {
"value": "https://example.org",
"value": {
"en": "https://example.org",
},
"label": "Imprint URL",
"help_text": "This should point e.g. to a part of your website that has your contact details and legal "
"information.",
@@ -1478,8 +1484,12 @@ def test_patch_event_settings(token_client, organizer, event, team):
format='json'
)
assert resp.status_code == 200
assert resp.data['contact_url'] == "https://example.com/contact"
assert resp.data['imprint_url'] == "https://example.com"
assert resp.data['contact_url'] == {
"en": "https://example.com/contact",
}
assert resp.data['imprint_url'] == {
"en": "https://example.com",
}
assert resp.data['seating_allow_blocked_seats_for_channel'] == ['web']
assert not resp.data['reusable_media_active']
event.settings.flush()
@@ -1542,8 +1552,12 @@ def test_patch_event_settings(token_client, organizer, event, team):
format='json'
)
assert resp.status_code == 200
assert resp.data['contact_url'] == "https://example.org/contact"
assert resp.data['imprint_url'] == "https://example.org"
assert resp.data['contact_url'] == {
"en": "https://example.org/contact",
}
assert resp.data['imprint_url'] == {
"en": "https://example.org",
}
event.settings.flush()
assert event.settings.contact_url == 'https://example.org/contact'
assert event.settings.imprint_url == 'https://example.org'