From e1ebde703039bcbc59364e04a630e884e3814ac7 Mon Sep 17 00:00:00 2001 From: Motornyuk Sergey Date: Mon, 21 Mar 2016 14:35:09 +0200 Subject: [PATCH] [#227] 'harvest_source_show_status' not found Added try block and try to clear action's cache in case exception raised --- ckanext/harvest/plugin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ckanext/harvest/plugin.py b/ckanext/harvest/plugin.py index ba55724..2a941c3 100644 --- a/ckanext/harvest/plugin.py +++ b/ckanext/harvest/plugin.py @@ -107,7 +107,14 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm, DefaultTranslation): log.error('Harvest source not found for dataset {0}'.format(data_dict['id'])) return data_dict - data_dict['status'] = p.toolkit.get_action('harvest_source_show_status')(context, {'id': source.id}) + st_action_name = 'harvest_source_show_status' + try: + status_action = p.toolkit.get_action(st_action_name) + except KeyError: + logic.clear_actions_cache() + status_action = p.toolkit.get_action(st_action_name) + + data_dict['status'] = status_action(context, {'id': source.id}) elif not 'type' in data_dict or data_dict['type'] != DATASET_TYPE_NAME: # This is a normal dataset, check if it was harvested and if so, add