Skip to content
Snippets Groups Projects
Commit 17b548ec authored by Antoine Lambert's avatar Antoine Lambert
Browse files

fix target link in api directory view when a directory entry is a revision (e.g. git submodules)

parent 6147ae97
No related branches found
No related tags found
No related merge requests found
......@@ -141,11 +141,16 @@ def enrich_directory(directory, context_url=None):
reverse('content', kwargs={'q': 'sha1_git:%s' % target})
if context_url:
directory['file_url'] = context_url + directory['name'] + '/'
else:
elif target_type == 'dir':
directory['target_url'] = reverse('directory',
kwargs={'sha1_git': target})
if context_url:
directory['dir_url'] = context_url + directory['name'] + '/'
else:
directory['target_url'] = reverse('revision',
kwargs={'sha1_git': target})
if context_url:
directory['rev_url'] = context_url + directory['name'] + '/'
return directory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment