summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2016-07-13 05:27:28 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2016-07-13 05:27:28 (GMT)
commit31c48872507f3834210d2a92641943aeac9abc2f (patch)
tree06681da312b0c3771d7e575b4ffce5044263f5c8
parent7dafb96d9779a30ad976328536d45302a2e49e28 (diff)
downloadscrutiny-31c48872507f3834210d2a92641943aeac9abc2f.zip
scrutiny-31c48872507f3834210d2a92641943aeac9abc2f.tar.gz
scrutiny-31c48872507f3834210d2a92641943aeac9abc2f.tar.bz2
handle case of no installed module
-rw-r--r--scrutiny/projects/views.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scrutiny/projects/views.py b/scrutiny/projects/views.py
index 0f19f6d..8233b0e 100644
--- a/scrutiny/projects/views.py
+++ b/scrutiny/projects/views.py
@@ -141,10 +141,13 @@ class ProjectSummaryHistoryView(DetailView):
}
module_names = previous_versions.keys()
for module_name in module_names:
- installed_version = InstalledVersion.objects.filter(
- version__module__name=module_name,
- service__platform=validation_platform).exclude(
- version__version='').order_by('-timestamp')[0]
+ try:
+ installed_version = InstalledVersion.objects.filter(
+ version__module__name=module_name,
+ service__platform=validation_platform).exclude(
+ version__version='').order_by('-timestamp')[0]
+ except IndexError:
+ continue
if not installed_version.version.version:
continue
if installed_version.version.version == previous_versions[module_name]: