[#18] Get package dict on after_delete to check type

No need for #615 in core then
This commit is contained in:
amercader 2013-03-13 17:31:39 +00:00
parent 1b11b00946
commit cd6c1b56a8
1 changed files with 5 additions and 2 deletions

View File

@ -47,9 +47,12 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm):
_update_harvest_source_object(context, data_dict) _update_harvest_source_object(context, data_dict)
def after_delete(self, context, data_dict): def after_delete(self, context, data_dict):
if 'type' in data_dict and data_dict['type'] == DATASET_TYPE_NAME:
package_dict = p.toolkit.get_action('package_show')(context, {'id': data_dict['id']})
if 'type' in package_dict and package_dict['type'] == DATASET_TYPE_NAME:
# Delete the actual HarvestSource object # Delete the actual HarvestSource object
_delete_harvest_source_object(context, data_dict) _delete_harvest_source_object(context, package_dict)
def after_show(self, context, data_dict): def after_show(self, context, data_dict):