Skip to content

Commit

Permalink
[#1033] Fix validation in term_translation_update_many.
Browse files Browse the repository at this point in the history
Now checks that data is present and that it is a list.
  • Loading branch information
johnglover committed Jun 24, 2013
1 parent faf6514 commit c06534a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ckan/logic/action/update.py
Expand Up @@ -764,11 +764,10 @@ def term_translation_update_many(context, data_dict):
'''
model = context['model']


if not data_dict.get('data') and isinstance(data_dict, list):
if not (data_dict.get('data') and isinstance(data_dict.get('data'), list)):
raise ValidationError(
{'error':
'term_translation_update_many needs to have a list of dicts in field data'}
{'error': ['term_translation_update_many needs to have a '
'list of dicts in field data']}
)

context['defer_commit'] = True
Expand Down

0 comments on commit c06534a

Please sign in to comment.