From 30ddef692ad0ef1fb4e4606bb17c64c0ebe5ae4f Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 22 Feb 2021 23:38:45 +0100 Subject: [PATCH] cast to string before calling truncate, else fails (int has no option len()) --- pygeoapi/templates/collections/items/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygeoapi/templates/collections/items/index.html b/pygeoapi/templates/collections/items/index.html index 635bce4..746cc5e 100644 --- a/pygeoapi/templates/collections/items/index.html +++ b/pygeoapi/templates/collections/items/index.html @@ -88,13 +88,13 @@ {% for ft in data['features'] %} - {{ ft.id | truncate( 12 ) }} + {{ ft.id | string | truncate( 12 ) }} {% if data['title_field'] %} - {{ ft['properties'][data['title_field']] | truncate( 35 ) }} + {{ ft['properties'][data['title_field']] | string | truncate( 35 ) }} {% endif %} {% for k, v in ft['properties'].items() %} {% if loop.index < 5 and k not in [data['id_field'], data['title_field'], 'extent'] %} - {{ v | truncate( 35 ) }} + {{ v | string | truncate( 35 ) }} {% endif %} {% endfor %}