Skip to content

Commit

Permalink
Merge pull request #5 from ykhadilkar-rei/master
Browse files Browse the repository at this point in the history
Release 1.17
  • Loading branch information
Yatin Khadilkar committed Apr 9, 2014
2 parents 9815a7f + 4beb3e3 commit 314f2ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ckanext/datajson/build_datajson.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def make_datajson_entry(package):
("issued", extras.get('release_date', extras.get("Date Released", None))),
('accrualPeriodicity', extras.get('accrual_periodicity', None)),
# ('language', extras.get('language', None)),
("dataQuality", extras.get('data_quality', True)),
("dataQuality", extras.get('data_quality', None)),
("landingPage", extras.get('homepage_url', package["url"])),
('rssFeed', extras.get('rss_feed', None)),
('systemOfRecords', extras.get('system_of_records', None)),
Expand Down Expand Up @@ -101,8 +101,13 @@ def make_datajson_entry(package):
# When saved from UI DataQuality value is stored as "on" instead of True.
# Check if value is "on" and replace it with True.
striped_retlist_dict = OrderedDict(striped_retlist)
if striped_retlist_dict.get('dataQuality') == "on":
if striped_retlist_dict.get('dataQuality') == "on" \
or striped_retlist_dict.get('dataQuality') == "true" \
or striped_retlist_dict.get('dataQuality') == "True":
striped_retlist_dict['dataQuality'] = True
elif striped_retlist_dict.get('dataQuality') == "false" \
or striped_retlist_dict.get('dataQuality') == "False":
striped_retlist_dict['dataQuality'] = False

return striped_retlist_dict

Expand Down

0 comments on commit 314f2ee

Please sign in to comment.