Skip to content

Commit 314f2ee

Browse files
author
Yatin Khadilkar
committed
Merge pull request #5 from ykhadilkar-rei/master
Release 1.17
2 parents 9815a7f + 4beb3e3 commit 314f2ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ckanext/datajson/build_datajson.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def make_datajson_entry(package):
4141
("issued", extras.get('release_date', extras.get("Date Released", None))),
4242
('accrualPeriodicity', extras.get('accrual_periodicity', None)),
4343
# ('language', extras.get('language', None)),
44-
("dataQuality", extras.get('data_quality', True)),
44+
("dataQuality", extras.get('data_quality', None)),
4545
("landingPage", extras.get('homepage_url', package["url"])),
4646
('rssFeed', extras.get('rss_feed', None)),
4747
('systemOfRecords', extras.get('system_of_records', None)),
@@ -101,8 +101,13 @@ def make_datajson_entry(package):
101101
# When saved from UI DataQuality value is stored as "on" instead of True.
102102
# Check if value is "on" and replace it with True.
103103
striped_retlist_dict = OrderedDict(striped_retlist)
104-
if striped_retlist_dict.get('dataQuality') == "on":
104+
if striped_retlist_dict.get('dataQuality') == "on" \
105+
or striped_retlist_dict.get('dataQuality') == "true" \
106+
or striped_retlist_dict.get('dataQuality') == "True":
105107
striped_retlist_dict['dataQuality'] = True
108+
elif striped_retlist_dict.get('dataQuality') == "false" \
109+
or striped_retlist_dict.get('dataQuality') == "False":
110+
striped_retlist_dict['dataQuality'] = False
106111

107112
return striped_retlist_dict
108113

0 commit comments

Comments
 (0)