Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def maoyan_test(request):
username = request.session.get('user', '')
tasks = Webcasestep.objects.all()
if request.method == "POST":
upperlevel_id = request.POST.get("casename_id")
write_to_txt(upperlevel_id)
time.sleep(1)
readwebcaseSQL(upperlevel_id)
return render(request, "webcasestep_manage.html",{"user": username, "tasks": tasks})
def remove_test_txt(request):
username = request.session.get('user', '')
tasks = Webcasestep.objects.all()
if request.method =="POST":
txtname = request.POST.get("casename_id")
remove_webtest_txt(txtname)
return render(request, "webcasestep_manage.html", {"user": username, "tasks": tasks})
def delete_web_casesteps(request):
webcaseid = request.POST.get("casename_id")
username = request.session.get('user', '')
webcase = Webcase.objects.get(id=webcaseid)
webcasesteps = Webcasestep.objects.all()
stepid = request.POST.get("step_id")
Webcasestep.objects.filter(Webcase_id=webcaseid,id=stepid).delete()
return render(request, "webcasestep_manage.html",{"user": username, "webcasesteps": webcasesteps, "webcase": webcase})
def display_web_casesteps(request):
username = request.session.get('user', '')
webcaseid = request.GET.get('webcase.id',None)
webcase = Webcase.objects.get(id=webcaseid)
keywords = Webcase_keywords.objects.all()
webcasesteps = Webcasestep.objects.all()
return render(request,"webcasestep_manage.html",{"user": username,"webcasesteps":webcasesteps,"webcase":webcase,"keywords":keywords})