From 88606643724cf5454312fd137bce9714faf35859 Mon Sep 17 00:00:00 2001 From: Pradeep CE (cep) Date: Feb 13 2017 17:41:38 +0000 Subject: Fix incorrect value for variable 'path' Something like `{% set path = path + '/' + file %}` doesn't seem to work because in Jinja2, because the variables set inside loops don't seem to persist between iterations. This approach works around that limitation. --- diff --git a/pagure/templates/edit_file.html b/pagure/templates/edit_file.html index 9d162d8..62b67e0 100644 --- a/pagure/templates/edit_file.html +++ b/pagure/templates/edit_file.html @@ -21,10 +21,7 @@ identifier=branchname) }}">  {{ branchname }}{% for file in filename.split('/') %} - {% set path = file %} - {% if not loop.first %} - {% set path = path + '/' + file %} - {% endif %} + {% set path = '/'.join(filename.split('/')[:loop.index]) %} {% if loop.index != loop.length %}