Require Cross Approval

This commit is contained in:
AndyGrant committed 2019-02-18 04:00:09 -05:00
1 parent 95e40f58ac
commit 87a61690fe
1 file changed
+5 -1
+5 -1
View File
@@ -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