Commit e55f0972 by Bence Dányi

webui: return partial view instead of redirect

parent 9a946089
......@@ -523,11 +523,15 @@ def vm_resume(request, iid, *args, **kwargs):
@require_POST
def vm_renew(request, which, iid, *args, **kwargs):
try:
get_object_or_404(Instance, id=iid, owner=request.user).renew()
vm = get_object_or_404(Instance, id=iid, owner=request.user)
vm.renew()
messages.success(request, _('Virtual machine is successfully renewed.'))
except:
messages.error(request, _('Failed to renew virtual machine.'))
return redirect('/')
return render_to_response('box/vm/entry.html', RequestContext(request, {
'vm': vm
}))
@login_required
@require_POST
......
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