Skip to content

Commit

Permalink
Cubro el caso que los grupos del package no esten definidos
Browse files Browse the repository at this point in the history
  • Loading branch information
lrromero committed Mar 12, 2018
1 parent f275654 commit 6e5b208
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydatajson/ckan_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def map_dataset_to_package(dataset, catalog_id, owner_org, theme_taxonomy,
label = next(x['label'] for x in theme_taxonomy if x['id'] == theme)
package['tags'].append({'name': label})
else:
package['groups'] += [{'name': title_to_name(theme, decode=False)} for theme in themes]
package['groups'] = package.get('groups', []) + [{'name': title_to_name(theme, decode=False)}
for theme in themes]

return package

Expand Down

0 comments on commit 6e5b208

Please sign in to comment.