mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
instance poweron checks is_template attribute. templates should not be e started. by @honza801
This commit is contained in:
parent
e80bbfd85b
commit
1b913fd4d6
1 changed files with 16 additions and 8 deletions
|
@ -313,6 +313,10 @@ def instance(request, compute_id, vname):
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if 'poweron' in request.POST:
|
if 'poweron' in request.POST:
|
||||||
|
if instance.is_template:
|
||||||
|
msg = _("Templates cannot be started.")
|
||||||
|
error_messages.append(msg)
|
||||||
|
else:
|
||||||
conn.start()
|
conn.start()
|
||||||
msg = _("Power On")
|
msg = _("Power On")
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
|
@ -904,6 +908,10 @@ def instances_actions(request):
|
||||||
instance.compute.password,
|
instance.compute.password,
|
||||||
instance.compute.type)
|
instance.compute.type)
|
||||||
if 'poweron' in request.POST:
|
if 'poweron' in request.POST:
|
||||||
|
if instance.is_template:
|
||||||
|
msg = _("Templates cannot be started.")
|
||||||
|
messages.error(request, msg)
|
||||||
|
else:
|
||||||
msg = _("Power On")
|
msg = _("Power On")
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
conn.start(name)
|
conn.start(name)
|
||||||
|
|
Loading…
Reference in a new issue