summaryrefslogtreecommitdiff
path: root/pagehandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'pagehandler.py')
-rwxr-xr-xpagehandler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pagehandler.py b/pagehandler.py
index ea01be1..0c444b2 100755
--- a/pagehandler.py
+++ b/pagehandler.py
@@ -100,7 +100,8 @@ class PackageCmd:
else:
p = self.toc.getpackage(self.name)
print "Content-Type: text/html\n\n"
- if not p or len(p) > 1:
+ # if there is no match, or if multiple versions were returned
+ if not p or len(set(map(lambda x: x.version, p.values()))) > 1:
print SearchResultsTemplate(self.name, self.toc)
else:
print PackageVersTemplate(p.popitem()[1])