Commit 9dc46e70 authored by carlosribas's avatar carlosribas
Browse files

Avoid IndexError

parent 4ef641e8
......@@ -314,8 +314,9 @@ class GenomeBrowserView(TemplateView):
# if species is not defined - use homo_sapiens as default, if specified and wrong - 404
if 'species' in request.GET:
kwargs['genome'] = request.GET['species']
ensembl_assembly = EnsemblAssembly.objects.filter(ensembl_url=kwargs['genome']).all()[0]
if not ensembl_assembly:
try:
ensembl_assembly = EnsemblAssembly.objects.filter(ensembl_url=kwargs['genome']).all()[0]
except IndexError:
raise Http404
else:
kwargs['genome'] = 'homo_sapiens'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment