Bump utils to 39.4.0

Adds delivery estimates for letters posted to Europe or the rest of the
world.
This commit is contained in:
Chris Hill-Scott
2020-05-22 10:43:12 +01:00
parent b98f4561fa
commit d828c1c481
5 changed files with 17 additions and 13 deletions

View File

@@ -134,6 +134,14 @@ def view_notification(service_id, notification_id):
status='sending,delivered,failed',
)
if notification['notification_type'] == 'letter':
estimated_letter_delivery_date = get_letter_timings(
notification['created_at'],
postage=notification['postage']
).earliest_delivery
else:
estimated_letter_delivery_date = None
return render_template(
'views/notifications/notification.html',
finished=(notification['status'] in (DELIVERED_STATUSES + FAILURE_STATUSES)),
@@ -154,10 +162,7 @@ def view_notification(service_id, notification_id):
created_at=notification['created_at'],
updated_at=notification['updated_at'],
help=get_help_argument(),
estimated_letter_delivery_date=get_letter_timings(
notification['created_at'],
postage=notification['postage']
).earliest_delivery,
estimated_letter_delivery_date=estimated_letter_delivery_date,
notification_id=notification['id'],
postage=notification['postage'],
can_receive_inbound=(current_service.has_permission('inbound_sms')),

View File

@@ -23,5 +23,5 @@ notifications-python-client==5.5.1
awscli-cwlogs>=1.4,<1.5
itsdangerous==1.1.0
git+https://github.com/alphagov/notifications-utils.git@39.3.0#egg=notifications-utils==39.3.0
git+https://github.com/alphagov/notifications-utils.git@39.4.0#egg=notifications-utils==39.4.0
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha

View File

@@ -25,14 +25,14 @@ notifications-python-client==5.5.1
awscli-cwlogs>=1.4,<1.5
itsdangerous==1.1.0
git+https://github.com/alphagov/notifications-utils.git@39.3.0#egg=notifications-utils==39.3.0
git+https://github.com/alphagov/notifications-utils.git@39.4.0#egg=notifications-utils==39.4.0
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha
## The following requirements were added by pip freeze:
awscli==1.18.63
awscli==1.18.66
bleach==3.1.4
boto3==1.10.38
botocore==1.16.13
botocore==1.16.16
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.2
@@ -67,7 +67,7 @@ redis==3.5.2
requests==2.23.0
rsa==3.4.2
s3transfer==0.3.3
six==1.14.0
six==1.15.0
smartypants==2.0.1
statsd==3.3.0
texttable==1.6.2

View File

@@ -443,8 +443,7 @@ def notification_json(
if status is None:
status = 'delivered'
links = {}
if template_type == 'letter':
postage = postage or 'second'
postage = postage or 'second'
if with_links:
links = {

View File

@@ -530,13 +530,13 @@ def test_notification_page_does_not_show_cancel_link_for_letter_which_cannot_be_
'europe',
'Postage: international',
'letter-postage-international',
'Estimated delivery date: Wednesday 6 January',
'Estimated delivery date: Friday 8 January',
),
(
'rest-of-world',
'Postage: international',
'letter-postage-international',
'Estimated delivery date: Wednesday 6 January',
'Estimated delivery date: Monday 11 January',
),
))
@freeze_time("2016-01-01 18:00")