summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2008-06-26 02:07:33 +0200
committerSean Finney <seanius@debian.org>2008-06-26 02:07:33 +0200
commitd31d22dcca484a6fd51a7d4857426038063e00c7 (patch)
treeb8ae96a40405e052fcee1ca6807d1286a2920152
parent585aa315a541ef3ba714e0c32424ad2f530ea92c (diff)
downloadpatch-tracker-d31d22dcca484a6fd51a7d4857426038063e00c7.tar.gz
slightly refine the package results handling
-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])