From 4570b4637be287e3e4fa5c5f9255d01628b03e5d Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Mon, 27 Feb 2017 16:23:21 +0100 Subject: [PATCH] Move attachment parsing on the node level --- pillar/web/nodes/routes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pillar/web/nodes/routes.py b/pillar/web/nodes/routes.py index c5b2e65e..11ef6f6f 100644 --- a/pillar/web/nodes/routes.py +++ b/pillar/web/nodes/routes.py @@ -193,6 +193,9 @@ def view(node_id): for child in children: child.picture = get_file(child.picture, api=api) + if 'description' in node: + node['description'] = attachments.render_attachments(node, node['description']) + if request.args.get('format') == 'json': node = node.to_dict() node['url_edit'] = url_for('nodes.edit', node_id=node['_id']) @@ -265,9 +268,6 @@ def _view_handler_asset(node, template_path, template_action, link_allowed): # Treat it as normal file (zip, blend, application, etc) asset_type = 'file' - if 'description' in node: - node['description'] = attachments.render_attachments(node, node['description']) - template_path = os.path.join(template_path, asset_type) return template_path, template_action