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
c958a20e
authored
Apr 22, 2016
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
request: disable requests for deleted vms
parent
cb2d9cff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
circle/dashboard/templates/dashboard/_vm-renew.html
+1
-1
circle/dashboard/templates/dashboard/vm-detail/home.html
+2
-2
circle/request/views.py
+6
-0
No files found.
circle/dashboard/templates/dashboard/_vm-renew.html
View file @
c958a20e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<a
class=
"btn btn-default"
href=
"{{object.get_absolute_url}}"
data-dismiss=
"modal"
>
<a
class=
"btn btn-default"
href=
"{{object.get_absolute_url}}"
data-dismiss=
"modal"
>
{% trans "Cancel" %}
{% trans "Cancel" %}
</a>
</a>
{% if lease_types and not request.token_user %}
{% if
object.active and
lease_types and not request.token_user %}
<a
class=
"btn btn-primary"
id=
"vm-renew-request-lease-button"
<a
class=
"btn btn-primary"
id=
"vm-renew-request-lease-button"
href=
"{% url "
request
.
views
.
request-lease
"
vm_pk=
object.pk
%}"
>
href=
"{% url "
request
.
views
.
request-lease
"
vm_pk=
object.pk
%}"
>
<i
class=
"fa fa-forward"
></i>
<i
class=
"fa fa-forward"
></i>
...
...
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
c958a20e
...
@@ -59,8 +59,8 @@
...
@@ -59,8 +59,8 @@
{% if instance.is_expiring %}
<i
class=
"fa fa-warning-sign text-danger"
></i>
{% endif %}
{% if instance.is_expiring %}
<i
class=
"fa fa-warning-sign text-danger"
></i>
{% endif %}
<span
id=
"vm-details-renew-op"
>
<span
id=
"vm-details-renew-op"
>
{% with op=op.renew %}{% if op %}
{% with op=op.renew %}{% if op %}
<a
href=
"{{op.get_url}}"
class=
"btn btn-
{{op.effect}} btn-xs
<a
href=
"{{op.get_url}}"
class=
"btn btn-
xs operation operation-{{ op.op }}
operation operation-{{op.op}
}"
>
{% if op.disabled %}btn-default disabled{% else %}btn-{{op.effect}}{% endif %
}"
>
<i
class=
"fa fa-{{op.icon}}"
></i>
<i
class=
"fa fa-{{op.icon}}"
></i>
{{op.name}}
{{op.name}}
</a>
</a>
...
...
circle/request/views.py
View file @
c958a20e
...
@@ -208,6 +208,12 @@ class VmRequestMixin(LoginRequiredMixin, object):
...
@@ -208,6 +208,12 @@ class VmRequestMixin(LoginRequiredMixin, object):
user
=
self
.
request
.
user
user
=
self
.
request
.
user
if
not
vm
.
has_level
(
user
,
self
.
user_level
):
if
not
vm
.
has_level
(
user
,
self
.
user_level
):
raise
PermissionDenied
()
raise
PermissionDenied
()
if
vm
.
destroyed_at
:
message
=
_
(
"Instance
%(instance)
s has already been destroyed."
)
messages
.
error
(
self
.
request
,
message
%
{
'instance'
:
vm
.
name
})
return
redirect
(
vm
.
get_absolute_url
())
return
super
(
VmRequestMixin
,
self
)
.
dispatch
(
*
args
,
**
kwargs
)
return
super
(
VmRequestMixin
,
self
)
.
dispatch
(
*
args
,
**
kwargs
)
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
...
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