Skip to content
Snippets Groups Projects
Commit 5cf69293 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Hardened openness score mapping

parent 06d82c2a
No related branches found
No related tags found
2 merge requests!41Version 2.0.0,!38Merge py3 into dev
......@@ -359,10 +359,9 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
d = json.loads(dict_pkg['validated_data_dict'])
score = -1
for r in d['resources']:
if 'qa' in r:
if 'openness_score' in r['qa']:
s = int(r['qa']['openness_score'])
if s > score:
score = s
if ('qa' in r) and (type(r['qa']) is dict) and ('openness_score' in r['qa']):
s = int(r['qa']['openness_score'])
if s > score:
score = s
if score > 0:
dict_pkg['openness'] = OdshPlugin.scores[score-1]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment