Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
6a7f2737
Commit
6a7f2737
authored
Oct 02, 2018
by
Guilhem Saurel
Browse files
some github project have a "NOASSERTION" license…
parent
321d8955
Pipeline
#1536
passed with stages
in 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
6a7f2737
...
...
@@ -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'
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment