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
This commit is contained in:
Lucas Palm 2016-01-12 11:09:58 -06:00
parent eb1a7ccbcc
commit 25312e8a46
1 changed files with 4 additions and 4 deletions

View File

@ -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"))