Skip to content
GitLab
Menu
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
313512d6
Commit
313512d6
authored
Jun 11, 2019
by
Guilhem Saurel
Browse files
travis can have None branches…
parent
1db14039
Pipeline
#4631
canceled with stage
in 2 minutes and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
313512d6
...
...
@@ -4,8 +4,6 @@ import re
import
time
from
subprocess
import
check_output
import
git
import
requests
from
django.conf
import
settings
from
django.core.mail
import
mail_admins
from
django.db
import
models
...
...
@@ -17,6 +15,9 @@ from django.utils import timezone
from
django.utils.dateparse
import
parse_datetime
from
django.utils.safestring
import
mark_safe
import
requests
import
git
from
autoslug
import
AutoSlugField
from
ndh.models
import
Links
,
NamedModel
,
TimeStampedModel
from
ndh.utils
import
enum_to_choices
,
query_sum
...
...
@@ -589,7 +590,7 @@ class Repo(TimeStampedModel):
if
self
.
travis_id
is
not
None
:
travis
=
Forge
.
objects
.
get
(
source
=
SOURCES
.
travis
)
for
build
in
travis
.
api_list
(
f
'/repo/
{
self
.
travis_id
}
/builds'
,
name
=
'builds'
):
if
self
.
project
.
tag_set
.
filter
(
name
=
build
[
'branch'
][
'name'
]).
exists
():
if
build
[
'branch'
]
is
None
or
self
.
project
.
tag_set
.
filter
(
name
=
build
[
'branch'
][
'name'
]).
exists
():
continue
branch_name
=
f
'
{
self
.
forge
.
slug
}
/
{
self
.
namespace
.
slug
}
/
{
build
[
"branch"
][
"name"
]
}
'
branch
,
created
=
Branch
.
objects
.
get_or_create
(
name
=
branch_name
,
project
=
self
.
project
,
repo
=
self
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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