Don’t let _set_status_filters mutate original list

Mutating stuff is scary and prone to problems. Better for it to
return a new list instead.
This commit is contained in:
Chris Hill-Scott
2016-08-05 10:18:27 +01:00
parent d0ef913520
commit 01bb2ada0a
2 changed files with 20 additions and 20 deletions

View File

@@ -14,9 +14,9 @@
<h1 class="heading-large">
<span class="visually-hidden">
{%- if request_args.get('status') != 'delivered,failed' -%}
{%- if status != 'delivered,failed' -%}
{%- for label, option, _, _ in status_filters -%}
{%- if request_args.get('status', 'delivered,failed') == option -%}{{label}} {% endif -%}
{%- if status == option -%}{{label}} {% endif -%}
{%- endfor -%}
{%- endif -%}
</span>
@@ -29,7 +29,7 @@
{{ pill(
'Status',
status_filters,
request_args.get('status', '')
status
) }}
</div>