Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e39cd3f8
authored
Oct 15, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix deploy view/form
parent
ac20a85d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
circle/dashboard/forms.py
+2
-2
circle/dashboard/views/vm.py
+1
-1
No files found.
circle/dashboard/forms.py
View file @
e39cd3f8
...
@@ -910,7 +910,7 @@ class VmAddInterfaceForm(OperationForm):
...
@@ -910,7 +910,7 @@ class VmAddInterfaceForm(OperationForm):
self
.
fields
[
'vlan'
]
=
field
self
.
fields
[
'vlan'
]
=
field
class
VmDeployForm
(
forms
.
Form
):
class
VmDeployForm
(
Operation
Form
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
choices
=
kwargs
.
pop
(
'choices'
,
None
)
choices
=
kwargs
.
pop
(
'choices'
,
None
)
...
@@ -919,7 +919,7 @@ class VmDeployForm(forms.Form):
...
@@ -919,7 +919,7 @@ class VmDeployForm(forms.Form):
if
choices
is
not
None
:
if
choices
is
not
None
:
self
.
fields
.
insert
(
0
,
'node'
,
forms
.
ModelChoiceField
(
self
.
fields
.
insert
(
0
,
'node'
,
forms
.
ModelChoiceField
(
queryset
=
choices
,
label
=
_
(
'Node'
),
help_text
=
_
(
queryset
=
choices
,
required
=
False
,
label
=
_
(
'Node'
),
help_text
=
_
(
"Deploy virtual machine to this node "
"Deploy virtual machine to this node "
"(blank allows scheduling automatically)."
)))
"(blank allows scheduling automatically)."
)))
...
...
circle/dashboard/views/vm.py
View file @
e39cd3f8
...
@@ -634,7 +634,7 @@ class VmDeployView(FormOperationMixin, VmOperationView):
...
@@ -634,7 +634,7 @@ class VmDeployView(FormOperationMixin, VmOperationView):
form_class
=
VmDeployForm
form_class
=
VmDeployForm
def
get_form_kwargs
(
self
):
def
get_form_kwargs
(
self
):
kwargs
=
super
(
Vm
Operation
View
,
self
)
.
get_form_kwargs
()
kwargs
=
super
(
Vm
Deploy
View
,
self
)
.
get_form_kwargs
()
if
self
.
request
.
user
.
is_superuser
:
if
self
.
request
.
user
.
is_superuser
:
online
=
(
n
.
pk
for
n
in
online
=
(
n
.
pk
for
n
in
Node
.
objects
.
filter
(
enabled
=
True
)
if
n
.
online
)
Node
.
objects
.
filter
(
enabled
=
True
)
if
n
.
online
)
...
...
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