diff --git a/app/__init__.py b/app/__init__.py index 035bb2a9b..a3e22afbd 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -279,12 +279,15 @@ def format_date_short(date): def format_delta(date): + delta = ( + datetime.now(timezone.utc) + ) - ( + gmt_timezones(date) + ) + if delta < timedelta(seconds=30): + return "just now" return ago.human( - ( - datetime.now(timezone.utc) - ) - ( - dateutil.parser.parse(date) - ), + delta, future_tense='{} from now', # No-one should ever see this past_tense='{} ago', precision=1 diff --git a/app/main/views/send.py b/app/main/views/send.py index a5fb034e1..9feee1257 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -77,7 +77,6 @@ def get_example_letter_address(key): return { 'address line 1': 'A. Name', 'address line 2': '123 Example Street', - 'address line 3': 'Example town', 'postcode': 'XM4 5HQ' }.get(key, '') @@ -237,13 +236,13 @@ def _check_messages(service_id, template_type, upload_id, letters_as_pdf=False): if request.args.get('from_test'): extra_args = {'help': 1} if request.args.get('help', '0') != '0' else {} - if len(template.placeholders): + if len(template.placeholders) or template.template_type == 'letter': back_link = url_for( '.send_test', service_id=service_id, template_id=template.id, **extra_args ) else: back_link = url_for( - '.choose_template', service_id=service_id, **extra_args + '.view_template', service_id=service_id, template_id=template.id, **extra_args ) choose_time_form = None else: diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 5b0e4e7e3..cb6831304 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -287,13 +287,17 @@ def edit_service_template(service_id, template_id): }, current_service) template_change = get_template(template, current_service).compare_to(new_template) if template_change.has_different_placeholders and not request.form.get('confirm'): + example_column_headings = ( + first_column_headings[new_template.template_type] + + list(new_template.placeholders) + ) return render_template( 'views/templates/breaking-change.html', template_change=template_change, new_template=new_template, - column_headings=list(ascii_uppercase[:len(new_template.placeholders) + 1]), + column_headings=list(ascii_uppercase[:len(example_column_headings)]), example_rows=[ - first_column_headings[new_template.template_type] + list(new_template.placeholders), + example_column_headings, get_example_csv_rows(new_template), get_example_csv_rows(new_template) ], diff --git a/app/notify_client/job_api_client.py b/app/notify_client/job_api_client.py index ca487f303..d4dc8eb7e 100644 --- a/app/notify_client/job_api_client.py +++ b/app/notify_client/job_api_client.py @@ -12,6 +12,8 @@ class JobApiClient(NotifyAdminAPIClient): 'finished', 'cancelled', 'sending limits exceeded', + 'ready to send', + 'sent to dvla' } def __init__(self): diff --git a/app/templates/views/roadmap.html b/app/templates/views/roadmap.html index fc15b1897..769918389 100644 --- a/app/templates/views/roadmap.html +++ b/app/templates/views/roadmap.html @@ -37,7 +37,7 @@

May 2017