Skip to content
Snippets Groups Projects
Commit cb04a02e authored by chbaeh's avatar chbaeh
Browse files

fix problem with score if qa not present

parent 48bb63ff
Branches
Tags
No related merge requests found
......@@ -8,9 +8,14 @@ log = logging.getLogger(__name__)
def odsh_openness_score_dataset_html(dataset):
score = 0
#dataset = json.loads(dataset)
for resource in dataset.get('resources'):
resources = dataset.get('resources')
if resources is None:
return 0
for resource in resources:
r_qa = resource.get('qa')
if r_qa:
try:
qa = ast.literal_eval(resource.get('qa'))
qa = ast.literal_eval()
resource_score = qa.get('openness_score')
if resource_score > score:
score = resource_score
......
{% ckan_extends %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment