Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
Show 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):
self
.
fields
[
'vlan'
]
=
field
class
VmDeployForm
(
forms
.
Form
):
class
VmDeployForm
(
Operation
Form
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
choices
=
kwargs
.
pop
(
'choices'
,
None
)
...
...
@@ -919,7 +919,7 @@ class VmDeployForm(forms.Form):
if
choices
is
not
None
:
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 "
"(blank allows scheduling automatically)."
)))
...
...
circle/dashboard/views/vm.py
View file @
e39cd3f8
...
...
@@ -634,7 +634,7 @@ class VmDeployView(FormOperationMixin, VmOperationView):
form_class
=
VmDeployForm
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
:
online
=
(
n
.
pk
for
n
in
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