Handle lists as CSV field values

Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/128

This means that `RecipientCSV` will sometimes return the value of a cell
in a spreadsheet as a `list`, not a `string`. So we need to handle that,
rather than putting a Python representation (`['one', 'two', 'three']`)
on the page.

This commit handles it by putting a bulleted list on the page instead.

This breaks our model of showing the spreadsheet as it appears in Excel
or whatever, because we’re showing the aggregation of the columns into a
list. However:
- this is the easier thing to do for now
- it might actually be more usable because it keeps the table narrower
This commit is contained in:
Chris Hill-Scott
2017-03-24 11:51:47 +00:00
parent f41b95fe0c
commit b0a995beb2
2 changed files with 10 additions and 2 deletions

View File

@@ -81,7 +81,15 @@
{% macro text_field(text, status='') -%}
{% call field(status=status) %}
{{ text }}
{% if text is iterable and text is not string %}
<ul class="list list-bullet">
{% for item in text %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% else %}
{{ text }}
{% endif %}
{% endcall %}
{%- endmacro %}

View File

@@ -31,4 +31,4 @@ notifications-python-client>=3.1,<3.2
awscli>=1.11,<1.12
awscli-cwlogs>=1.4,<1.5
git+https://github.com/alphagov/notifications-utils.git@13.10.0#egg=notifications-utils==13.10.0
git+https://github.com/alphagov/notifications-utils.git@14.0.0#egg=notifications-utils==14.0.0