Commit 8c2ea6bf by tarokkk

one: try to the suspend time

parent c2acf969
......@@ -226,6 +226,8 @@ $(function() {
success: function(data, b, xhrRequest) {
window.location.href = '/'; //xhrRequest.getResponseHeader("Location");
//alert(xhrRequest.getResponseHeader("Location"));
window.location.href = xhrRequest.getResponseHeader("Location");
}
})
}
......
......@@ -225,13 +225,16 @@ def vm_new(request, template=None, share=None, redir=True):
extra = "<RECONTEXT>YES</RECONTEXT>"
try:
#Gány quota
if share == None or (share != None and share.get_running() < share.instance_limit) or extra:
if (share == None or (share != None and share.get_running() < share.instance_limit)) or extra:
time_of_suspend = None
time_of_delete = None
if TYPES[share.type]['suspend']:
try:
TYPES[share.type]['suspend']
time_of_suspend = TYPES[share.type]['suspend']+datetime.now()
if TYPES[share.type]['delete']:
TYPES[share.type]['delete']
time_of_delete = TYPES[share.type]['delete']+datetime.now()
except:
pass
i = Instance.submit(base, request.user, extra=extra, share=share)
i.time_of_suspend = time_of_suspend
i.time_of_delete = time_of_delete
......
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