Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fdf0285a
authored
Aug 29, 2016
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: remove unnecessary get_rename_operation() method
parent
9211165c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
16 deletions
+2
-16
circle/dashboard/templates/dashboard/vm-detail.html
+1
-1
circle/dashboard/templates/dashboard/vm-detail/home.html
+1
-1
circle/dashboard/views/vm.py
+0
-14
No files found.
circle/dashboard/templates/dashboard/vm-detail.html
View file @
fdf0285a
...
...
@@ -55,7 +55,7 @@
</div>
<h1>
<div
id=
"vm-details-rename"
class=
"vm-details-home-rename-form-div"
>
<form
action=
"{{
rename_op
.get_url }}"
method=
"POST"
id=
"vm-details-rename-form"
>
<form
action=
"{{
op.rename
.get_url }}"
method=
"POST"
id=
"vm-details-rename-form"
>
{% csrf_token %}
<div
class=
"input-group vm-details-home-name"
>
<input
id=
"vm-details-rename-name"
class=
"form-control input-sm"
name=
"new_name"
type=
"text"
value=
"{{ instance.name }}"
/>
...
...
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
fdf0285a
...
...
@@ -16,7 +16,7 @@
<small
class=
"vm-details-home-edit-name"
>
{{ instance.name }}
</small>
</div>
<div
class=
"js-hidden vm-details-home-rename-form-div"
id=
"vm-details-home-rename"
>
<form
action=
"{{
rename_op
.get_url }}"
method=
"POST"
>
<form
action=
"{{
op.rename
.get_url }}"
method=
"POST"
>
{% csrf_token %}
<div
class=
"input-group"
>
<input
type=
"text"
name=
"new_name"
value=
"{{ instance.name }}"
class=
"form-control input-sm"
/>
...
...
circle/dashboard/views/vm.py
View file @
fdf0285a
...
...
@@ -134,7 +134,6 @@ class VmDetailView(GraphMixin, CheckedDetailView):
kwargs
=
{
'pk'
:
self
.
object
.
pk
}),
'ops'
:
ops
,
'op'
:
{
i
.
op
:
i
for
i
in
ops
},
'rename_op'
:
self
.
get_rename_operation
(
instance
),
'connect_commands'
:
user
.
profile
.
get_connect_commands
(
instance
),
'hide_tutorial'
:
hide_tutorial
,
'fav'
:
instance
.
favourite_set
.
filter
(
user
=
user
)
.
exists
(),
...
...
@@ -284,19 +283,6 @@ class VmDetailView(GraphMixin, CheckedDetailView):
return
HttpResponseRedirect
(
"
%
s#activity"
%
self
.
object
.
get_absolute_url
())
def
get_rename_operation
(
self
,
instance
):
v
=
VmRenameView
try
:
op
=
v
.
get_op_by_object
(
instance
)
op
.
check_auth
(
self
.
request
.
user
)
op
.
check_precond
()
except
PermissionDenied
as
e
:
logger
.
debug
(
'Not showing operation
%
s for
%
s:
%
s'
,
'rename'
,
instance
,
unicode
(
e
))
except
Exception
:
return
v
.
bind_to_object
(
instance
,
disabled
=
True
)
return
v
.
bind_to_object
(
instance
)
class
VmTraitsUpdate
(
SuperuserRequiredMixin
,
UpdateView
):
form_class
=
TraitsForm
...
...
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