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
68dc757d
authored
Apr 25, 2016
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-447' into 'master'
Disable requests for deleted vms Closes #447 See merge request !368
parents
f3ef3c2a
c958a20e
Show 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 @
68dc757d
...
...
@@ -8,7 +8,7 @@
<a
class=
"btn btn-default"
href=
"{{object.get_absolute_url}}"
data-dismiss=
"modal"
>
{% trans "Cancel" %}
</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"
href=
"{% url "
request
.
views
.
request-lease
"
vm_pk=
object.pk
%}"
>
<i
class=
"fa fa-forward"
></i>
...
...
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
68dc757d
...
...
@@ -59,8 +59,8 @@
{% if instance.is_expiring %}
<i
class=
"fa fa-warning-sign text-danger"
></i>
{% endif %}
<span
id=
"vm-details-renew-op"
>
{% with op=op.renew %}{% if op %}
<a
href=
"{{op.get_url}}"
class=
"btn btn-
{{op.effect}} btn-xs
operation operation-{{op.op}
}"
>
<a
href=
"{{op.get_url}}"
class=
"btn btn-
xs operation operation-{{ op.op }}
{% if op.disabled %}btn-default disabled{% else %}btn-{{op.effect}}{% endif %
}"
>
<i
class=
"fa fa-{{op.icon}}"
></i>
{{op.name}}
</a>
...
...
circle/request/views.py
View file @
68dc757d
...
...
@@ -208,6 +208,12 @@ class VmRequestMixin(LoginRequiredMixin, object):
user
=
self
.
request
.
user
if
not
vm
.
has_level
(
user
,
self
.
user_level
):
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
)
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