[ckan-changes] commit/ckan: John Glover: [logic] Temporary Bug fix: check for license was throwing and error

Bitbucket commits-noreply at bitbucket.org
Tue Jul 26 08:27:25 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/4b59ab34137d/
changeset:   4b59ab34137d
branch:      feature-1141-moderated-edits-ajax
user:        John Glover
date:        2011-07-26 10:26:34
summary:     [logic] Temporary Bug fix: check for license was throwing and error
affected #:  1 file (158 bytes)

--- a/ckan/logic/action/get.py	Mon Jul 25 12:57:25 2011 +0100
+++ b/ckan/logic/action/get.py	Tue Jul 26 09:26:34 2011 +0100
@@ -49,8 +49,12 @@
         result_dict["resources"] = resource_list_dictize(result, context)
         license_id = result_dict['license_id']
         if license_id:
-            isopen = model.Package.get_license_register()[license_id].isopen()
-            result_dict['isopen'] = isopen
+            try:
+                isopen = model.Package.get_license_register()[license_id].isopen()
+                result_dict['isopen'] = isopen
+            except KeyError:
+                # TODO: create a log message this error?
+                result_dict['isopen'] = False 
         else:
             result_dict['isopen'] = False
         package_list.append(result_dict)

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list