chg: avoid duplicate URLs in hashlookup view

pull/299/head
Raphaël Vinot 2021-12-01 17:03:36 +01:00
parent 649d7714cf
commit e291fc6167
2 changed files with 4 additions and 1 deletions

View File

@ -516,6 +516,9 @@ def urls_rendered_page(tree_uuid: str):
@app.route('/tree/<string:tree_uuid>/hashlookup', methods=['GET']) @app.route('/tree/<string:tree_uuid>/hashlookup', methods=['GET'])
def hashlookup(tree_uuid: str): def hashlookup(tree_uuid: str):
merged, total_ressources = lookyloo.merge_hashlookup_tree(tree_uuid) merged, total_ressources = lookyloo.merge_hashlookup_tree(tree_uuid)
# We only want unique URLs for the template
for sha1, entries in merged.items():
entries['nodes'] = set(node.name for node in entries['nodes'])
return render_template('hashlookup.html', base_tree_uuid=tree_uuid, merged=merged, total_ressources=total_ressources) return render_template('hashlookup.html', base_tree_uuid=tree_uuid, merged=merged, total_ressources=total_ressources)

View File

@ -6,7 +6,7 @@
<dt class="col-sm-2">URLs in tree</dt> <dt class="col-sm-2">URLs in tree</dt>
<dd class="col-sm-10"> <dd class="col-sm-10">
{% for node in entries['nodes'] %} {% for node in entries['nodes'] %}
{{ node.name }} </br> {{ node }} </br>
{% endfor %} {% endfor %}
</dd> </dd>
</dl> </dl>