Fix tree link on layer list for layers with no subdirectory

We always need to replace %path% in the URL, not just when there is a
non-blank path to replace it with.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2013-09-13 11:39:13 +01:00
parent aa2c67c92d
commit dcd312b9fb

View File

@ -143,10 +143,9 @@ class LayerBranch(models.Model):
if '%path%' in base_url: if '%path%' in base_url:
if extra_path: if extra_path:
url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '\\1', url) url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '\\1', url)
return url.replace('%path%', extra_path)
else: else:
url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '', url) url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '', url)
return url return url.replace('%path%', extra_path)
else: else:
return url + extra_path return url + extra_path
return None return None