Skip to content

Commit e210ee4

Browse files
committed
Rewrite the banner to be less clunky
I think it had too many words before, and it wasn’t gramatically correct in the singular case.
1 parent 8d475f3 commit e210ee4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/main/views/templates.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,10 @@ def edit_service_template(service_id, template_id, language=None): # noqa
775775
template.template_type == "letter" and template.welsh_page_count and language != "welsh"
776776
)
777777
if template_change.email_files_removed:
778+
multiple_files_removed = len(template_change.email_filenames_removed) > 1
778779
flash(
779-
f"Files for {formatted_list(template_change.email_filenames_removed)} have been removed from the template.", # noqa
780+
f"{formatted_list(template_change.email_filenames_removed)} "
781+
f"{'have' if multiple_files_removed else 'has'} been removed",
780782
"default_with_tick",
781783
)
782784
return redirect(

tests/app/main/views/test_templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3760,14 +3760,14 @@ def test_should_redirect_when_saving_a_template_email(
37603760
"00000000-0000-4000-8000-000000000001",
37613761
"00000000-0000-4000-8000-000000000002",
37623762
],
3763-
"Files for ‘invite.pdf’ and ‘form.pdf’ have been removed from the template.",
3763+
"‘invite.pdf’ and ‘form.pdf’ have been removed",
37643764
),
37653765
(
37663766
"For the appointment, you will just need ((form.pdf)) and ((map.pdf))",
37673767
[
37683768
"00000000-0000-4000-8000-000000000001",
37693769
],
3770-
"Files for ‘invite.pdf’ have been removed from the template.",
3770+
"‘invite.pdf’ has been removed",
37713771
),
37723772
),
37733773
)

0 commit comments

Comments
 (0)