Skip to content

Commit

Permalink
Pass page_size to ImageChooserViewSet (#11884)
Browse files Browse the repository at this point in the history
Fixes #11813
  • Loading branch information
rohitsrma authored and gasman committed Apr 26, 2024
1 parent 714a187 commit bfdd13f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/releases/6.2.md
Expand Up @@ -19,7 +19,8 @@ depth: 1

### Bug fixes

* ...
* Make `WAGTAILIMAGES_CHOOSER_PAGE_SIZE` setting functional again (Rohit Sharma)


### Documentation

Expand Down
3 changes: 2 additions & 1 deletion wagtail/images/views/chooser.py
Expand Up @@ -72,7 +72,7 @@ def get_creation_form_kwargs(self):
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"

Expand Down Expand Up @@ -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…")
Expand Down

0 comments on commit bfdd13f

Please sign in to comment.