From 0e892f8cbfbc95d0754a9bd781586fd46053bd3b Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Fri, 17 Feb 2012 11:01:08 +0100 Subject: [PATCH] Tweak vocab API error messages Make them all use the same string, easier to translate --- ckan/logic/action/delete.py | 3 +-- ckan/logic/action/update.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ckan/logic/action/delete.py b/ckan/logic/action/delete.py index d3e15ec3139..cdc1703a5d4 100644 --- a/ckan/logic/action/delete.py +++ b/ckan/logic/action/delete.py @@ -105,12 +105,11 @@ def task_status_delete(context, data_dict): def vocabulary_delete(context, data_dict): model = context['model'] - user = context['user'] vocab_id = data_dict['id'] vocab_obj = model.vocabulary.Vocabulary.get(vocab_id) if vocab_obj is None: - raise NotFound + raise NotFound(_('Could not find vocabulary "%s"') % vocab_id) check_access('vocabulary_delete', context, data_dict) diff --git a/ckan/logic/action/update.py b/ckan/logic/action/update.py index 66616487409..cf16ae87645 100644 --- a/ckan/logic/action/update.py +++ b/ckan/logic/action/update.py @@ -615,7 +615,6 @@ def group_update_rest(context, data_dict): def vocabulary_update(context, data_dict): model = context['model'] - user = context['user'] vocab_id = data_dict['id'] model.Session.remove() @@ -623,7 +622,7 @@ def vocabulary_update(context, data_dict): vocab = model.vocabulary.Vocabulary.get(vocab_id) if vocab is None: - raise NotFound(_('Vocabulary was not found.')) + raise NotFound(_('Could not find vocabulary "%s"') % vocab_id) check_access('vocabulary_update', context, data_dict)