Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/attributecode/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def request_license_data(api_url, api_key, license_key):
response_content = response.read().decode('utf-8')
# FIXME: this should be an ordered dict
license_data = json.loads(response_content)
if not license_data['results']:
if not license_data.get('results', []):
msg = u"Invalid 'license': %s" % license_key
errors.append(Error(ERROR, msg))
except HTTPError as http_e:
Expand Down
2 changes: 1 addition & 1 deletion src/attributecode/attrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def generate(abouts, is_about_input, license_dict, scancode, min_license_score,
lic_name_expression = ' '.join(lic_name_expression_list)

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

# Sort the about objects by name
Expand Down