From 6f460ee1271ee42dee7111286973f9d3f58c6f60 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 1 Nov 2016 18:05:26 +0100 Subject: [PATCH] Fix for non existing attachments --- pillar/web/nodes/attachments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar/web/nodes/attachments.py b/pillar/web/nodes/attachments.py index ce9d8936..1eecf948 100644 --- a/pillar/web/nodes/attachments.py +++ b/pillar/web/nodes/attachments.py @@ -22,7 +22,7 @@ def render_attachments(node, field_value): # TODO: cache this based on the node's etag and attachment links expiry. - node_attachments = node[u'properties'][u'attachments'] + node_attachments = node.properties.attachments or {} if isinstance(node_attachments, list): log.warning('Old-style attachments property found on node %s. Ignoring them, ' 'will result in attachments not being found.', node[u'_id'])