aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-08-18 18:26:48 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-08-18 18:26:48 +0000
commit7a90ae0d45ea0901d71a184d2dc843f82f15c7da (patch)
treeeed9198282dd69caff1234bfc5e7309f74ada3f4 /web
parentUpdate the expiry date for the old forwards. (diff)
downloadpackages-7a90ae0d45ea0901d71a184d2dc843f82f15c7da.tar.gz
packages-7a90ae0d45ea0901d71a184d2dc843f82f15c7da.tar.bz2
packages-7a90ae0d45ea0901d71a184d2dc843f82f15c7da.zip
Watch out for empty licenses.
Diffstat (limited to 'web')
-rw-r--r--web/model.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/web/model.py b/web/model.py
index 998ca52..0810d18 100644
--- a/web/model.py
+++ b/web/model.py
@@ -481,11 +481,12 @@ class PackageDB(object):
pkg['meta'] = pkg_metadata
pkg['keywords'] = self.get_package_keywords(atom)
pkg['license'] = []
- for l in pkg_metadata['license'].split():
- if l[0].isalnum() and not l.endswith("?"):
- url = viewcvs_link('licenses/%s' % l)
- l = '<a href="%s">%s</a>' % (url, l)
- pkg['license'].append(l)
+ if pkg_metadata['license']:
+ for l in pkg_metadata['license'].split():
+ if l[0].isalnum() and not l.endswith("?"):
+ url = viewcvs_link('licenses/%s' % l)
+ l = '<a href="%s">%s</a>' % (url, l)
+ pkg['license'].append(l)
pkg['license'] = ' '.join(pkg['license'])
pkg['homepage'] = []
homepages = pkg_metadata['homepage'].split()