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
This commit is contained in:
Akihiro Motoki 2019-09-13 17:38:00 +09:00
parent 1208919617
commit cd1009bd2f

View File

@ -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,