Force page length when pagination is disabled
authorThierry Florac <thierry.florac@onf.fr>
Tue, 27 Nov 2018 13:33:17 +0100
changeset 258 fb5ab7398a1f
parent 257 cc4ae9a70a17
child 259 74ba42f88c7a
Force page length when pagination is disabled
src/pyams_default_theme/features/search/portlet/__init__.py
--- a/src/pyams_default_theme/features/search/portlet/__init__.py	Tue Nov 27 08:53:12 2018 +0100
+++ b/src/pyams_default_theme/features/search/portlet/__init__.py	Tue Nov 27 13:33:17 2018 +0100
@@ -53,6 +53,12 @@
 
     settings_interface = ISearchResultsPortletDefaultRendererSettings
 
+    def update(self):
+        settings = self.renderer_settings
+        if not settings.allow_pagination:
+            self.request.GET['length'] = '999'
+        super(SearchResultsPortletDefaultRenderer, self).update()
+
 
 @adapter_config(context=(ILocation, IPyAMSUserLayer, ISearchResultsView), provides=IBreadcrumbs)
 class BreadcrumbsAdapter(NullAdapter):