Skip to content

Commit

Permalink
change logic handling for url parsing in dataset detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
rwblair committed Sep 14, 2017
1 parent 6382a79 commit 8bb620b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion open_fmri/apps/dataset/views.py
Expand Up @@ -86,6 +86,8 @@ def get_context_data(self, **kwargs):
for link in revision.link_set.all().order_by('title'):
try:
filename = urlparse(link.url).path
if not filename:
continue
if filename[0] == '/':
filename = filename[1:]
count = S3File.objects.get(filename=filename).count
Expand All @@ -99,7 +101,7 @@ def get_context_data(self, **kwargs):
for link in links:
try:
filename = urlparse(link.url).path
if filename[0] == '/':
if filename and filename[0] == '/':
filename = filename[1:]
count = S3File.objects.get(filename=filename).count
context_links.append((link, count))
Expand Down

0 comments on commit 8bb620b

Please sign in to comment.