From 81c3881a1a3ec1fed134488a6b70b50c76d6edd6 Mon Sep 17 00:00:00 2001 From: amercader Date: Thu, 13 Dec 2012 18:00:07 +0000 Subject: [PATCH] Add active field to source dict --- ckanext/harvest/logic/action/get.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ckanext/harvest/logic/action/get.py b/ckanext/harvest/logic/action/get.py index d45f216..4032545 100644 --- a/ckanext/harvest/logic/action/get.py +++ b/ckanext/harvest/logic/action/get.py @@ -37,6 +37,10 @@ def harvest_source_show(context,data_dict): context['schema'] = harvest_source_db_to_form_schema() source_dict = logic.get_action('package_show')(context, data_dict) + # For compatibility with old code, add the active field + # based on the package state + source_dict['active'] = (source_dict['state'] == 'active') + return source_dict