[views] Do not select goto-ckan-dataset if there is no CKAN id
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 18 Dec 2014 14:03:55 +0100
changeset 46 cb011e37fd3c
parent 45 5e3ef3b319cf
child 48 9534a4c8d423
[views] Do not select goto-ckan-dataset if there is no CKAN id
views.py
--- a/views.py	Thu Dec 18 11:11:40 2014 +0100
+++ b/views.py	Thu Dec 18 14:03:55 2014 +0100
@@ -35,7 +35,7 @@
     """
     __regid__ = 'ckanpublish.goto-ckan-dataset'
     __select__ = (component.EntityCtxComponent.__select__ &
-                  score_entity(lambda x: hasattr(x, 'ckan_dataset_id')))
+                  score_entity(lambda x: getattr(x, 'ckan_dataset_id', False)))
     title = _('CKAN dataset')
     context = 'incontext'