Commit 9359d317 by Őry Máté

one: renew on resume

parent b4274949
...@@ -505,10 +505,12 @@ def vm_stop(request, iid, *args, **kwargs): ...@@ -505,10 +505,12 @@ def vm_stop(request, iid, *args, **kwargs):
@require_POST @require_POST
def vm_resume(request, iid, *args, **kwargs): def vm_resume(request, iid, *args, **kwargs):
try: 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.')) messages.success(request, _('Virtual machine is successfully resumed.'))
except: except:
messages.error(request, _('Failed to resume virtual machine.')) messages.error(request, _('Failed to resume virtual machine.'))
obj.renew()
return redirect('/') return redirect('/')
@login_required @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