mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Convert IntegerFields to GovukIntegerFields
Changes those fields in the following forms: - FreeSMSAllowance - ProviderForm - ProviderRatioForm - ServiceDataRetentionEditForm Includes changes to templates that use this form and associated tests.
This commit is contained in:
@@ -1192,7 +1192,7 @@ class NewOrganisationForm(
|
||||
|
||||
|
||||
class FreeSMSAllowance(StripWhitespaceForm):
|
||||
free_sms_allowance = IntegerField(
|
||||
free_sms_allowance = GovukIntegerField(
|
||||
'Numbers of text message fragments per year',
|
||||
validators=[
|
||||
DataRequired(message='Cannot be empty')
|
||||
@@ -1529,7 +1529,9 @@ class EstimateUsageForm(StripWhitespaceForm):
|
||||
|
||||
|
||||
class ProviderForm(StripWhitespaceForm):
|
||||
priority = IntegerField('Priority', [validators.NumberRange(min=1, max=100, message="Must be between 1 and 100")])
|
||||
priority = GovukIntegerField(
|
||||
'Priority', [validators.NumberRange(min=1, max=100, message="Must be between 1 and 100")]
|
||||
)
|
||||
|
||||
|
||||
class ProviderRatioForm(StripWhitespaceForm):
|
||||
@@ -2044,17 +2046,17 @@ class ServiceDataRetentionForm(StripWhitespaceForm):
|
||||
],
|
||||
validators=[DataRequired()],
|
||||
)
|
||||
days_of_retention = IntegerField(label="Days of retention",
|
||||
validators=[validators.NumberRange(min=3, max=90,
|
||||
message="Must be between 3 and 90")],
|
||||
)
|
||||
days_of_retention = GovukIntegerField(
|
||||
label="Days of retention",
|
||||
validators=[validators.NumberRange(min=3, max=90, message="Must be between 3 and 90")],
|
||||
)
|
||||
|
||||
|
||||
class ServiceDataRetentionEditForm(StripWhitespaceForm):
|
||||
days_of_retention = IntegerField(label="Days of retention",
|
||||
validators=[validators.NumberRange(min=3, max=90,
|
||||
message="Must be between 3 and 90")],
|
||||
)
|
||||
days_of_retention = GovukIntegerField(
|
||||
label="Days of retention",
|
||||
validators=[validators.NumberRange(min=3, max=90, message="Must be between 3 and 90")],
|
||||
)
|
||||
|
||||
|
||||
class ReturnedLettersForm(StripWhitespaceForm):
|
||||
|
||||
@@ -25,7 +25,7 @@ Provider - {{provider.display_name}}
|
||||
</ul>
|
||||
|
||||
{% call form_wrapper() %}
|
||||
{{ textbox(form.priority) }}
|
||||
{{ form.priority }}
|
||||
{{ page_footer('Save') }}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
{% call form_wrapper() %}
|
||||
{{ radios(form.notification_type) }}
|
||||
{{ textbox(form.days_of_retention) }}
|
||||
{{ form.days_of_retention }}
|
||||
{{ page_footer('Add') }}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
) }}
|
||||
{% call form_wrapper() %}
|
||||
{{ notification_type | capitalize}}
|
||||
{{ textbox(form.days_of_retention) }}
|
||||
{{ form.days_of_retention }}
|
||||
{{ page_footer('Save') }}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
'Free text message allowance',
|
||||
back_link=url_for('.service_settings', service_id=current_service.id)
|
||||
) }}
|
||||
{{ textbox(form.free_sms_allowance) }}
|
||||
{{ form.free_sms_allowance }}
|
||||
{{ page_footer('Save') }}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user