Commit 9359d317 by Őry Máté

one: renew on resume

parent b4274949
......@@ -505,10 +505,12 @@ def vm_stop(request, iid, *args, **kwargs):
@require_POST
def vm_resume(request, iid, *args, **kwargs):
try:
get_object_or_404(Instance, id=iid, owner=request.user).resume()
obj = get_object_or_404(Instance, id=iid, owner=request.user)
obj.resume()
messages.success(request, _('Virtual machine is successfully resumed.'))
except:
messages.error(request, _('Failed to resume virtual machine.'))
obj.renew()
return redirect('/')
@login_required
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment