Skip to content

Commit

Permalink
Fallback en map_dataset_to_package para que busque los themes por label
Browse files Browse the repository at this point in the history
  • Loading branch information
lrromero committed Nov 23, 2018
1 parent 02b9388 commit c78f923
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pydatajson/ckan_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ def map_dataset_to_package(catalog, dataset, owner_org, catalog_id=None,
logger.exception('Theme no presente en catálogo.')
continue
else:
package['groups'] = package.get('groups', []) + [
{'name': title_to_name(theme, decode=False)}
for theme in themes
]

package['groups'] = package.get('groups', [])
for theme in themes:
theme_dict = catalog.get_theme(identifier=theme) or\
catalog.get_theme(label=theme)
if theme_dict:
package['groups'].append(map_theme_to_group(theme_dict))
return package


Expand Down

0 comments on commit c78f923

Please sign in to comment.