Pass page_size to ImageChooserViewSet (#11884)

Fixes #11813
pull/11898/head
Rohit Sharma 2024-04-22 13:34:57 +00:00 zatwierdzone przez Matt Westcott
rodzic 714a1878c2
commit bfdd13f8a8
3 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -6,6 +6,7 @@ Changelog
* Optimize and consolidate redirects report view into the index view (Jake Howard, Dan Braghis)
* Support a `HOSTNAMES` parameter on `WAGTAILFRONTENDCACHE` to define which hostnames a backend should respond to (Jake Howard, sponsored by Oxfam America)
* Fix: Make `WAGTAILIMAGES_CHOOSER_PAGE_SIZE` setting functional again (Rohit Sharma)
6.1 (xx.xx.xxxx) - IN DEVELOPMENT

Wyświetl plik

@ -19,7 +19,8 @@ depth: 1
### Bug fixes
* ...
* Make `WAGTAILIMAGES_CHOOSER_PAGE_SIZE` setting functional again (Rohit Sharma)
### Documentation

Wyświetl plik

@ -72,7 +72,7 @@ class ImageCreationFormMixin(CreationFormMixin):
class BaseImageChooseView(BaseChooseView):
template_name = "wagtailimages/chooser/chooser.html"
results_template_name = "wagtailimages/chooser/results.html"
per_page = getattr(settings, "WAGTAILIMAGES_CHOOSER_PAGE_SIZE", 12)
per_page = 12
ordering = "-created_at"
construct_queryset_hook_name = "construct_image_chooser_queryset"
@ -309,6 +309,7 @@ class ImageChooserViewSet(ChooserViewSet):
preserve_url_parameters = ChooserViewSet.preserve_url_parameters + ["select_format"]
icon = "image"
per_page = getattr(settings, "WAGTAILIMAGES_CHOOSER_PAGE_SIZE", 10)
choose_one_text = _("Choose an image")
create_action_label = _("Upload")
create_action_clicked_label = _("Uploading…")