mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 17:38:50 -04:00
Merge branch 'master' into use_new_template_stats_endpoint
Conflicts: app/notify_client/template_statistics_api_client.py
This commit is contained in:
@@ -337,7 +337,7 @@ class ServiceSmsSender(Form):
|
||||
def validate_sms_sender(form, field):
|
||||
import re
|
||||
if field.data and not re.match('^[a-zA-Z0-9\s]+$', field.data):
|
||||
raise ValidationError('Sms text message sender can only contain alpha-numeric characters')
|
||||
raise ValidationError('Text message sender can only contain alpha-numeric characters')
|
||||
|
||||
|
||||
class ServiceBrandingOrg(Form):
|
||||
|
||||
@@ -17,11 +17,16 @@ class TemplateStatisticsApiClient(BaseAPIClient):
|
||||
if limit_days is not None:
|
||||
params['limit_days'] = limit_days
|
||||
|
||||
return self.get(
|
||||
response = self.get(
|
||||
url='/service/{}/template-statistics'.format(service_id),
|
||||
params=params
|
||||
)['data']
|
||||
|
||||
if len(response) > 0 and 'template' in response[0]:
|
||||
return response
|
||||
|
||||
return []
|
||||
|
||||
def get_template_statistics_for_template(self, service_id, template_id):
|
||||
|
||||
return self.get(
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">Check your email</h1>
|
||||
<p>We’ve sent an email to {{ session['user_details']['email'] }}.</p>
|
||||
<p>An email has been sent to {{ session['user_details']['email'] }}.</p>
|
||||
<p>Click the link in the email to continue your registration.</p>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -12,7 +12,7 @@ Check your mobile number – GOV.UK Notify
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">Check your mobile number</h1>
|
||||
|
||||
<p>Check your mobile phone number is correct and then resend the confirmation code.</p>
|
||||
<p>Check your mobile phone number is correct and then resend the security code.</p>
|
||||
|
||||
<p>
|
||||
<label class="form-label" for="mobile">Mobile phone number</label>
|
||||
@@ -21,7 +21,7 @@ Check your mobile number – GOV.UK Notify
|
||||
|
||||
|
||||
<p>
|
||||
<a class="button" href="verify-mobile" role="button">Resend confirmation code</a>
|
||||
<a class="button" href="verify-mobile" role="button">Resend security code</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,11 +12,11 @@ Check your mobile number – GOV.UK Notify
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">Check your mobile number</h1>
|
||||
|
||||
<p>Check your mobile phone number is correct and then resend the confirmation code.</p>
|
||||
<p>Check your mobile phone number is correct and then resend the security code.</p>
|
||||
|
||||
<form autocomplete="off" method="post">
|
||||
{{ textbox(form.mobile_number) }}
|
||||
{{ page_footer("Resend confirmation code") }}
|
||||
{{ page_footer("Resend security code") }}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ GOV.UK Notify | Service settings
|
||||
<div class="grid-row">
|
||||
<div class="column-three-quarters">
|
||||
<p>
|
||||
We’ve sent a code to your new {{ thing }}.
|
||||
We’ve sent a security code to your new {{ thing }}.
|
||||
</p>
|
||||
<form method="post">
|
||||
{{ textbox(form_field) }}
|
||||
|
||||
@@ -10,7 +10,7 @@ Confirm your mobile number – GOV.UK Notify
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">Confirm your mobile number</h1>
|
||||
|
||||
<p>We’ve sent you a security code by text message.</p>
|
||||
<p>We’ve sent you a security code by text message.</p>
|
||||
|
||||
<p>
|
||||
<label class="form-label" for="email">Enter security code<br>
|
||||
|
||||
@@ -141,4 +141,4 @@ def test_sms_sender_form_validation(app_, mock_get_user_by_email):
|
||||
|
||||
form.sms_sender.data = '###########'
|
||||
form.validate()
|
||||
assert 'Sms text message sender can only contain alpha-numeric characters' == form.errors['sms_sender'][0]
|
||||
assert 'Text message sender can only contain alpha-numeric characters' == form.errors['sms_sender'][0]
|
||||
|
||||
@@ -66,7 +66,7 @@ def test_should_render_correct_resend_template_for_pending_user(app_,
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
assert page.h1.string == 'Check your mobile number'
|
||||
|
||||
expected = 'Check your mobile phone number is correct and then resend the confirmation code.'
|
||||
expected = 'Check your mobile phone number is correct and then resend the security code.'
|
||||
message = page.find_all('p')[1].text
|
||||
assert message == expected
|
||||
assert page.find('form').input['value'] == api_user_pending.mobile_number
|
||||
|
||||
Reference in New Issue
Block a user