From 25312e8a46572c254ea5b65189456085d43ad52e Mon Sep 17 00:00:00 2001 From: Lucas Palm Date: Tue, 12 Jan 2016 11:09:58 -0600 Subject: [PATCH] Add the max value to the tooltip for the "Items per Page" field Currently, the tooltip for the "Items per Page" field on the User Settings page does not show the maximum value that the field could be. Instead, the user must first enter the invalid value, only to receive an error notification that then shows the max value that the field will accept. To resolve this issue, the maximum value is displayed along with the other help text in the tooltip. The maximum value has a default value of 1000 unless set otherwise. Change-Id: I267cb5ac067f7f0b27224ca8dbba0c8e19199477 Closes-Bug: #1418430 --- openstack_dashboard/dashboards/settings/user/forms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index adf965640f..60dd9eb939 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -35,17 +35,17 @@ def _one_year(): class UserSettingsForm(forms.SelfHandlingForm): + max_value = getattr(settings, 'API_RESULT_LIMIT', 1000) language = forms.ChoiceField(label=_("Language")) timezone = forms.ChoiceField(label=_("Timezone")) pagesize = forms.IntegerField(label=_("Items Per Page"), min_value=1, - max_value=getattr(settings, - 'API_RESULT_LIMIT', - 1000), + max_value=max_value, help_text=_("Number of items to show per " "page (applies to the pages " "that have API supported " - "pagination)")) + "pagination, " + "Max Value: %s)") % max_value) instance_log_length = forms.IntegerField( label=_("Log Lines Per Instance"), min_value=1, help_text=_("Number of log lines to be shown per instance"))