From cd1009bd2f3d6a6ee6e1d00e3733bb9964bb1903 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Fri, 13 Sep 2019 17:38:00 +0900 Subject: [PATCH] Restore horizon.utils.functions.get_page_size() Commit 7c897b677cc4e7eb11d90fce448160c2b90d1ef4 moved get_page_size function from horizon.utils.functions to openstack_dashboard.utils.settings (as it is referred by the OpenStack API wrapper). However, it turns out that many horizon plugins calls the function and the above commit breaks horizon plugins. Considering we are in the last stage of Train development cycle, this commit restores horizon.utils.functions.get_page_size() to recover horizon plugins. Change-Id: I61be648b04ab0320a8c03b769e28ed74bbd242a1 Closes-Bug: #1843871 --- horizon/utils/functions.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/horizon/utils/functions.py b/horizon/utils/functions.py index 5ea558d6c3..10799d0e58 100644 --- a/horizon/utils/functions.py +++ b/horizon/utils/functions.py @@ -100,6 +100,15 @@ def save_config_value(request, response, key, value): return response +def get_page_size(request): + # NOTE(amotoki): The default value is defined in + # openstack_dashboard/defaults.py. To aviod circular reference, + # the hardcoded value 20 is used here. + # TODO(amotoki): Decide where API_RESULT_PAGE_SIZE should be defined, + # horizon or openstack_dashboard. + return get_config_value(request, 'API_RESULT_PAGE_SIZE', 20) + + def get_timezone(request): # Session and cookie store timezone as django_timezone. # In case there is no timezone neither in session nor in cookie,