Skip to content

Commit 207e376

Browse files
committed
Update the API to get licnese short name instead of the license name
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 70177a7 commit 207e376

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
@@ -99,7 +99,7 @@ def get_license_details_from_api(api_url, api_key, license_key):
9999
Missing values are provided as empty strings.
100100
"""
101101
license_data, errors = request_license_data(api_url, api_key, license_key)
102-
license_name = license_data.get('name', '')
102+
license_name = license_data.get('short_name', '')
103103
license_text = license_data.get('full_text', '')
104104
license_key = license_data.get('key', '')
105105
return license_name, license_key, license_text, errors

src/attributecode/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ def pre_process_and_fetch_license_dict(abouts, api_url=None, api_key=None, scanc
16121612
try:
16131613
json_url = urlopen(license_url)
16141614
data = json.loads(json_url.read())
1615-
license_name = data['name']
1615+
license_name = data['short_name']
16161616
license_text = urllib.request.urlopen(license_text_url).read().decode('utf-8')
16171617
license_filename = data['key'] + '.LICENSE'
16181618
lic_url = url + license_filename

0 commit comments

Comments
 (0)