Commit 6a7f2737 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

some github project have a "NOASSERTION" license…

parent 321d8955
Pipeline #1536 passed with stages
in 47 seconds
......@@ -930,13 +930,14 @@ def update_github(forge, namespace, data):
repo_data = repo.api_data()
if repo_data and 'license' in repo_data and repo_data['license']:
if 'spdx_id' in repo_data['license'] and repo_data['license']['spdx_id']:
try:
license = License.objects.get(spdx_id=repo_data['license']['spdx_id'])
except License.DoesNotExist:
raise ValueError('No License with spdx_id=' + repo_data['license']['spdx_id'])
repo.license = license
if not project.license:
project.license = license
if repo_data['license']['spdx_id'] != 'NOASSERTION':
try:
license = License.objects.get(spdx_id=repo_data['license']['spdx_id'])
except License.DoesNotExist:
raise ValueError('No License with spdx_id=' + repo_data['license']['spdx_id'])
repo.license = license
if not project.license:
project.license = license
if 'source' in repo_data:
repo.forked_from = repo_data['source']['id']
repo.open_issues = repo_data['open_issues_count']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment