Move attachment parsing on the node level
This commit is contained in:
parent
e381ca774e
commit
f51f616876
@ -193,6 +193,9 @@ def view(node_id):
|
|||||||
for child in children:
|
for child in children:
|
||||||
child.picture = get_file(child.picture, api=api)
|
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':
|
if request.args.get('format') == 'json':
|
||||||
node = node.to_dict()
|
node = node.to_dict()
|
||||||
node['url_edit'] = url_for('nodes.edit', node_id=node['_id'])
|
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)
|
# Treat it as normal file (zip, blend, application, etc)
|
||||||
asset_type = 'file'
|
asset_type = 'file'
|
||||||
|
|
||||||
if 'description' in node:
|
|
||||||
node['description'] = attachments.render_attachments(node, node['description'])
|
|
||||||
|
|
||||||
template_path = os.path.join(template_path, asset_type)
|
template_path = os.path.join(template_path, asset_type)
|
||||||
|
|
||||||
return template_path, template_action
|
return template_path, template_action
|
||||||
|
Loading…
x
Reference in New Issue
Block a user