Commit c8a7aae8 authored by David Read's avatar David Read
Browse files

Cope with displaying harvested license IDs which we dont recognize. e.g. uk-ogl3 from calderdale

parent c3fd6642
......@@ -1019,9 +1019,15 @@ def get_licenses(pkg):
if pkg.license_id and not licence:
# just license_id
licenses.append((pkg.license.title.split('::')[-1],
pkg.license.url,
pkg.license.isopen(), pkg.license.id == 'uk-ogl'))
if pkg.license:
licenses.append((pkg.license.title.split('::')[-1],
pkg.license.url,
pkg.license.isopen(),
pkg.license.id == 'uk-ogl'))
else:
# i.e. license_id is unknown - probably harvested from another ckan
licenses.append((pkg.license_id, None, None, None))
elif not licence:
# no licence at all
pass
......
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