Fix read_only panels for fields with translatable choice labels

pull/10773/head
Florent Lebreton 2023-08-09 08:48:20 +02:00 zatwierdzone przez Sage Abdullah
rodzic 1c12d96457
commit e7bb3e9d22
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: EB1A33CC51CC0217
5 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -22,6 +22,7 @@ Changelog
* Introduce `wagtail.admin.ui.tables.BooleanColumn` to display boolean values as icons (Sage Abdullah)
* Fix: Show not-`None` falsy values instead of blank in generic table cell template (Sage Abdullah)
* Fix: Fix `read_only` panels for fields with translatable choice labels (Florent Lebreton)
5.1 (01.08.2023)

Wyświetl plik

@ -722,6 +722,7 @@
* Henry Harutyunyan
* Alex Morega
* Scott Foster
* Florent Lebreton
## Translators

Wyświetl plik

@ -19,6 +19,7 @@ depth: 1
### Bug fixes
* Show not-`None` falsy values instead of blank in generic table cell template (Sage Abdullah)
* Fix `read_only` panels for fields with translatable choice labels (Florent Lebreton)
### Documentation

Wyświetl plik

@ -109,7 +109,7 @@ class FieldPanel(Panel):
if not isinstance(choices, ModelChoiceIterator) and choices:
labels = dict(choices)
display_values = [
labels.get(v, v) # Use raw value if no match found
str(labels.get(v, v)) # Use raw value if no match found
for v in (
# Account for single AND multiple choice fields
tuple(value)

Wyświetl plik

@ -81,8 +81,8 @@ from wagtail.snippets.models import register_snippet
from .forms import FormClassAdditionalFieldPageForm, ValidatedPageForm
EVENT_AUDIENCE_CHOICES = (
("public", "Public"),
("private", "Private"),
("public", _("Public")),
("private", _("Private")),
)