Skip to content

Commit

Permalink
Tweak vocab API error messages
Browse files Browse the repository at this point in the history
Make them all use the same string, easier to translate
  • Loading branch information
Sean Hammond committed Feb 17, 2012
1 parent aac7586 commit 0e892f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ckan/logic/action/delete.py
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions ckan/logic/action/update.py
Expand Up @@ -615,15 +615,14 @@ 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()
model.Session()._context = context

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)

Expand Down

0 comments on commit 0e892f8

Please sign in to comment.