From 87a61690fe52624f7e2be54f9b6b8fc46b0e6bcf Mon Sep 17 00:00:00 2001 From: AndyGrant Date: Mon, 18 Feb 2019 04:00:09 -0500 Subject: [PATCH] Require Cross Approval --- OpenBench/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenBench/views.py b/OpenBench/views.py index ffae7c2..c8ac849 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -349,8 +349,12 @@ def approveTest(request, id): if not profile.approver: raise Exception('No Approver Permissions on Account') - # Approve the provided test + # Ensure cross verification is used, except for the site admin test = Test.objects.get(id=id) + if test.author == profile.user.username and not profile.user.is_superuser: + raise Exception('Cross Approval is Required') + + # Approve the provided test if test.approved: return HttpResponseRedirect('/index/') test.approved = True