X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=django_simple%2Ftodo%2Fviews.py;h=e1ac2b0998a75b59d7d8733a620afa08b3e3588b;hb=521c866952798209eb432cc8f39434b04eeb56bf;hp=d9525b06056105eadb33a28f2d796cf05ee06ae7;hpb=5a52e318fbba09f787c91fadc8d364d16c2d452d;p=django_unres.git diff --git a/django_simple/todo/views.py b/django_simple/todo/views.py index d9525b0..e1ac2b0 100644 --- a/django_simple/todo/views.py +++ b/django_simple/todo/views.py @@ -904,10 +904,14 @@ def details1(request,user_id,task_id): def delete(request, task_id): Task.objects.get(id=task_id).delete() return redirect('/') - + @login_required def restart(request, task_id): task = get_object_or_404(Task, id=task_id) + restart0(task) + return redirect('/') + +def restart0(task): if os.path.isfile(task.jobdirname+'/finished'): os.remove(task.jobdirname+'/finished') task.running =1 @@ -940,8 +944,14 @@ def restart(request, task_id): os.rename('file_wham.tmp','file_wham.inp') ret_code = subprocess.Popen(' /opt/torque/bin/qsub pbs8.csh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) os.chdir('..') - return redirect('/') + return +def restart1(request, user_id, task_id): + task = get_object_or_404(Task, id=task_id) + user = task.owner + restart0(task) + return redirect('/details1/'+str(user)+'/'+str(task.id)+'/') + def refresh_done1(request, task_id): task = get_object_or_404(Task, id=task_id)