diff --git a/combo/apps/wcs/templates/combo/wcs/card.html b/combo/apps/wcs/templates/combo/wcs/card.html index 945fc9d8..f7909bf6 100644 --- a/combo/apps/wcs/templates/combo/wcs/card.html +++ b/combo/apps/wcs/templates/combo/wcs/card.html @@ -11,7 +11,7 @@ {% if card %}
{% for field in schema.fields %} - {% if 'varname' in field and field.varname %} + {% if 'varname' in field and field.varname and field.type != 'file' %} {% with card.fields|get:field.varname as value %}

{{ field.label }} diff --git a/tests/test_wcs.py b/tests/test_wcs.py index 6351644c..1485480f 100644 --- a/tests/test_wcs.py +++ b/tests/test_wcs.py @@ -185,6 +185,7 @@ WCS_CARDDEF_SCHEMA = { {'label': 'Field A', 'varname': 'fielda', 'type': 'string'}, {'label': 'Field B', 'varname': 'fieldb', 'type': 'bool'}, {'label': 'Field C', 'varname': 'fieldc', 'type': 'date'}, + {'label': 'Field D', 'varname': 'fieldd', 'type': 'file'}, {'label': 'Related', 'varname': 'related', 'type': 'item'}, {'label': 'Page', 'type': 'page'}, {'label': 'Comment', 'type': 'comment'}, @@ -205,6 +206,7 @@ WCS_CARD_DATA = { 'fielda': 'a', 'fieldb': True, 'fieldc': '2020-09-28', + 'fieldd': {'filename': 'file.pdf', 'url': 'http://some-url.com/download?f=42'}, 'related': 'Foo Bar', 'related_raw': 42, 'related_structured': {'id': 42, 'text': 'blah'}, @@ -1456,6 +1458,7 @@ def test_card_cell_render(mock_send, context): assert 'Related\n \n Foo Bar' in result assert 'related_raw' not in result assert 'related_structured' not in result + assert 'Field D' not in result @mock.patch('combo.apps.wcs.utils.requests.send', side_effect=mocked_requests_send)