Resolve issue #20

This commit is contained in:
AndyGrant committed 2018-07-01 12:31:02 -04:00
1 parent a0d0268d7b
commit 74b06458f7
1 file changed
+8 -2
+8 -2
View File
@@ -299,6 +299,8 @@ def approveTest(request, id):
# Approve the provided test
test = Test.objects.get(id=id)
if test.approved:
return HttpResponseRedirect('/index/')
test.approved = True
test.save()
@@ -326,8 +328,8 @@ def restartTest(request, id):
# Restart the provided test
test = Test.objects.get(id=id)
if test.passed or test.failed:
raise Exception('Test Already Finished via SPRT')
if not test.finished:
return HttpResponseRedirect('/index/')
test.finished = False
test.save()
@@ -355,6 +357,8 @@ def stopTest(request, id):
# Stop the provided test
test = Test.objects.get(id=id)
if test.finished:
return HttpResponseRedirect('/index/')
test.finished = True
test.save()
@@ -382,6 +386,8 @@ def deleteTest(request, id):
# Delete the provided test
test = Test.objects.get(id=id)
if test.deleted:
return HttpResponseRedirect('/index/')
test.deleted = True
test.save()