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
010256f0
Commit
010256f0
authored
Apr 12, 2018
by
Guilhem Saurel
Browse files
docker view: reverse TARGETS enum
parent
c01294f0
Pipeline
#554
passed with stages
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/views.py
View file @
010256f0
...
...
@@ -5,7 +5,7 @@ from django_filters.views import FilterView
from
django_tables2
import
RequestConfig
from
django_tables2.views
import
SingleTableMixin
,
SingleTableView
from
.
import
filters
,
models
,
tables
from
.
import
filters
,
models
,
tables
,
utils
class
ForgesView
(
SingleTableView
):
...
...
@@ -98,5 +98,7 @@ def docker(request):
cmd
=
'build'
if
'cmd'
in
request
.
GET
and
request
.
GET
[
'cmd'
]
in
[
'push'
,
'pull'
,
'build'
]:
cmd
=
request
.
GET
.
pop
(
'cmd'
)
if
'target'
in
request
.
GET
:
request
.
GET
[
'target'
]
=
int
(
utils
.
TARGETS
.
__getitem__
(
request
.
GET
[
'target'
]))
images
=
models
.
Image
.
objects
.
filter
(
**
request
.
GET
.
dict
())
return
HttpResponse
(
'
\n
'
.
join
([
' '
.
join
(
getattr
(
image
,
cmd
)())
for
image
in
images
]),
content_type
=
"text/plain"
)
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