Skip to content

Commit 0efe90b

Browse files
committed
Merge branch 'develop' of https://github.com/nexB/aboutcode-toolkit.git into develop
2 parents d3afee0 + ec7fc87 commit 0efe90b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/attributecode/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def request_license_data(api_url, api_key, license_key):
6060
response_content = response.read().decode('utf-8')
6161
# FIXME: this should be an ordered dict
6262
license_data = json.loads(response_content)
63-
if not license_data['results']:
63+
if not license_data.get('results', []):
6464
msg = u"Invalid 'license': %s" % license_key
6565
errors.append(Error(ERROR, msg))
6666
except HTTPError as http_e:

src/attributecode/attrib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def generate(abouts, is_about_input, license_dict, scancode, min_license_score,
172172
lic_name_expression = ' '.join(lic_name_expression_list)
173173

174174
# Add the license name expression string into the about object as a custom field
175-
custom_field = StringField(name=name, value=lic_name_expression, present=True)
175+
custom_field = StringField(name='license_name_expression', value=lic_name_expression, present=True)
176176
setattr(about, 'license_name_expression', custom_field)
177177

178178
# Sort the about objects by name

0 commit comments

Comments
 (0)