Skip to content

Commit

Permalink
[1720][logic/converters] Update for change in
Browse files Browse the repository at this point in the history
location of Vocabulary get function
  • Loading branch information
johnglover committed Feb 7, 2012
1 parent 0ad2fc3 commit 431a3b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckan/logic/converters.py
Expand Up @@ -44,23 +44,21 @@ def callable(key, data, errors, context):
if k[0] == 'tags':
n = max(n, k[1] + 1)

# validate
for tag in new_tags:
tag_length_validator(tag, context)
tag_name_validator(tag, context)
v = vocabulary.get(vocab)
v = model.Vocabulary.get(vocab)
if not v:
raise Invalid(_('Tag vocabulary "%s" does not exist') % vocab)

for num, tag in enumerate(new_tags):
data[('tags', num+n, 'name')] = tag
data[('tags', num+n, 'vocabulary_id')] = v.id

return callable

def convert_from_tags(vocab):
def callable(key, data, errors, context):
v = vocabulary.get(vocab)
v = model.Vocabulary.get(vocab)
if not v:
raise Invalid(_('Tag vocabulary "%s" does not exist') % vocab)

Expand Down

0 comments on commit 431a3b9

Please sign in to comment.