Skip to content

Commit

Permalink
Assign a default value to dataset type when dictizing
Browse files Browse the repository at this point in the history
This makes search queries much easier
  • Loading branch information
amercader authored and tobes committed Jan 9, 2013
1 parent 71ee549 commit 783856d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/lib/dictization/model_dictize.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def package_dictize(pkg, context):
result_dict['isopen'] = pkg.isopen if isinstance(pkg.isopen,bool) else pkg.isopen()

# type
result_dict['type']= pkg.type
# if null assign the default value to make searching easier
result_dict['type']= pkg.type if pkg.type else u'dataset'

# licence
if pkg.license and pkg.license.url:
Expand Down

0 comments on commit 783856d

Please sign in to comment.